The Strongloop Loopback documentation does not say anything about object retrieval using bitwise filters.
Example like in Loopback API documentation :
// Just an example of syntax, it does not do bitwise filter
Inventory.find({where: {status: {gt: 4}});
With a direct connection to MongoDB, I can do :
// Select items with 3rd bit on in `status` field
db.inventory.find({status: {$mod: [4, 0]}});
Can I do the same behind Loopback model interface ?
In MongoDB docs they say that a $were condition can do the same, while more expensive :
db.inventory.find( { $where: "this.qty % 4 == 0" } )
Could I be doing the following in loopback :
Inventory.find({where: "this.qty % 4 == 0"});
Or it would fail ?
Is the whole idea of using a bitwise-oriented status field in my model overkill ? Should I just use some kind of array field containing a list of string status ? Isn't it too expensive in terms of DB storage ?
Thanks