You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to find a document by its "id", the library gives me a runtime error. I'd like to know whether this is a bug or there is another right way. Thanks.
varSchema=require('jugglingdb').Schema;varschema=newSchema('mongodb',{host: 'localhost',database: 'try_jugglingdb',debug: true});varChair=schema.define('Chair',{id: String});Chair.create({id: '__id__'},function(err,doc){// Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex charactersChair.find('__id__',function(err,doc){console.log(doc);});// Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex charactersChair.findOne({where: {id: '__id__'}},function(err,doc){console.log(doc);});// OK.Chair.findOne({where: {_id: '__id__'}},function(err,doc){console.log(doc);});});
Versions:
nodejs v0.10.32
jugglingdb 0.3.0
jugglingdb-mongodb 0.0.4-4
The text was updated successfully, but these errors were encountered:
piglovesyou
changed the title
Cannot find a document by its id
Cannot find a document by its "id"
Nov 10, 2014
When I try to find a document by its "id", the library gives me a runtime error. I'd like to know whether this is a bug or there is another right way. Thanks.
Versions:
The text was updated successfully, but these errors were encountered: