Closed yuchienho closed 10 years ago
I don't think this is a bug. In the first case, you're not passing any sort of filter, so it returns the first result it can find in the DB. In the second case, you're explicitly trying to match the "id" property against the undefined non-value. This is the result I'd expect.
geddy.model.User.first(undefined, function (err, user) { if (err) { throw err; } if (user) { console.log('find'); } }
get return "find", the user is the first item in my db.
geddy.model.User.first({id: undefined}, function (err, user) { if (err) { throw err; } if (user) { console.log('find'); } }
get no return, the user is null.
is this a bug?