Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying by field with ObjectId value does not work #9

Open
irnc opened this issue Apr 29, 2013 · 2 comments
Open

Querying by field with ObjectId value does not work #9

irnc opened this issue Apr 29, 2013 · 2 comments

Comments

@irnc
Copy link

irnc commented Apr 29, 2013

Assuming that in blogs collection every document have authorId field with ObjectId value, following query from Queries README does not work because userId argument is a String and it is not converted to ObjectId.

store.query.expose('blogs', 'authoredBy', function (userId) {
  return this.where('authorId').equals(userId);
});
@brozot
Copy link

brozot commented May 26, 2013

hello

this issue is solved? because i have the same problem

thanks

@irnc
Copy link
Author

irnc commented May 27, 2013

@brozot you can work around this issue by duplicating authorId string data in authorIdString property and using it for queries. Or you can use model.id() to explicitly set string IDs to documents so there would be no problem for query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants