0

I want to find an object in my collection which satisfies the following: getDistance(userDefinedPosition, positionFromDocument) == true.

So I would like to do something like this

Users.find( getDistance(userDefinedPosition, positionFromDocument) == true, function( ... ) ) 

So userDefinedPosition is value while positionFromDocument is a field from inside a possible match.

1 Answer 1

2

Try the following:

Users.$where(getDistance(userDefinedPosition, this.positionFromDocument)).exec(function( ... ))

See http://mongoosejs.com/docs/2.7.x/docs/finding-documents.html

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.