I'm running into two issues with Derby and Mongo. I come from a MySQL and Redis background so maybe I'm just doing something wrong?
1) It seems I can't search for an Id whose type is ObjectId.
model.query("users").byKey(params.userId);
Will only match records whose _id is a string.. Which I guess would be okay, except when the data is "updated" Racer will create a new record with an ObjectId _id! So basically I can't ever retrieve a document by id that I've inserted with Racer!
2) Every time I do a query I get back an object of objects such as:
{ '$spec': true,
'4fcd4c8e6c8c89d97ed90f4a': { "username": ... },
'4fcd4c8e6c8c89d97ed90f4b': { "username": ... },
Which means I have to convert it into a list of objects. I wrote a function that creates a list of the _id's, then assigns it to a model variable for use with refList. It feels like such a hack, this can't be the right way to do it.
Queries were just substantially updated in version 0.3.11. Models now have built-in model.filter() and model.sort() methods which will replace the need to manually build a list of keys and emit much more efficient array update events to Derby.
Please see the Queries README.