I have this document:
...
"username" : "torayeff",
"profile" : {
...
"friends" : [
{
"_id" : "aSD4wmMEsFnYLcvmP",
"state" : "active"
},
{
"_id" : "ShFTXxuQLAxWCh4cq",
"state" : "active"
},
{
"_id" : "EQjoKMNBey7WPGamC",
"state" : "new-request"
}
]
...
}
...
This is query for getting only "state" attribute of given user:
Meteor.users.findOne({_id: userId1, 'profile.friends._id': userId2},
{fields: {_id: 0, 'profile.friends.state.$':1} });
In meteor I am receiving this error:
Exception while simulating the effect of invoking 'activateFriendship' Error: Minimongo doesn't support $ operator in projections yet...
How can I rewrite above query without having error in minimongo?