I have sort of an odd question in that I know “how” something works, but not necessarily what to call it. I know that if I use Meteor.users.findOne({_id: "xxxxxx"})
I will get the document associated with that user. I also know that if I use Meteor.users.findOne({_id: "DXiirg8zcsxFcGYvX"})['lastName']
i will get the user’s last name, effectively filtering the returned document for that one field. I’m having problems finding documentation on the “filtering” brackets. What are they called? Are they part of Mongo?
No, it’s Javascript regular Object Key access.
Let say you have a JS Object foo {bar: 1, baz: 2}, to access the value of bar you write foo[“bar”] or foo.bar
1 Like
Thank you. I suppose I couldn’t see the forest for the trees, as it were. I was digging through MongoDB documentation rather than considering the obvious.
1 Like