-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add Collection#findOne #4
base: master
Are you sure you want to change the base?
Add Collection#findOne #4
Conversation
FYI most of the changes are because I compiled with a newer version of babel. Aside from that and regenerating the docs, the real changes are in this commit d74a5fe |
I am glad that you are using ZangoDB and I appreciate the contribution. I looked at the API documentation for the MongoDB node driver and saw that the I went ahead and implemented the method for ZangoDB a little differently than you did so as to support a callback: a8bc729 If you could comment on the change to Thanks! |
Yeah, if you run the |
Don't worry about going through it, I know what the problem is. What I would like to know, though, is if MongoDB ensures document order with disjunction queries. If so, your change is useful for more reasons than just tests. |
I ran through the test case in mongo shell and it does concur with the test expectation: db.docs.insert([{x:2,g:3}, {x:2,g:8} ,{x:2,g:8,z:10}, {x:3,z:3}, {x:4,k:8}, {x:6,g:9}, {x:10,k:4}, {x:undefined}, {x:null}, {x:[{k:2}, {k:8}]}])
db.docs.findOne({ x: { $in: [2, 4, 8] } })
// => { "_id" : ObjectId("591606893f674ab10d9e9c0a"), "x" : 2, "g" : 3 } So without that change the test fails with You might want to cherry pick in this commit 1768292 to get the test coverage for your implementation of |
Great work. I committed a fix, although iterating in reverse rather than using I am going to go through some files to cherry pick. The |
Noticed this method was missing and it was easy to add, so here you go if this is helpful.
Not sure how closely you intend to mirror mongodb, but I'm using zango on the front end and mongodb on the backend in an isomorphic React app, so getting as close as possible to full mongodb compatibility is best for me.
Thanks for a great implementation.