method of dbo::collection to test whether object belongs to collection
Could you provide method of dbo::collection to test whether object belongs to collection?
Currently only way to do it is using of collection.find:
if(p->tags.find().where("id = ?").bind(cooking.id()).resultList().size() == 1)
It can be replaced with
Updated by Koen Deforche about 12 years ago
- Assignee set to Koen Deforche
A great feature!
To be STL compliant, that would need to be either (or both):
p->tags.count(cooking) == 1
p->tags.find(cooking) != p->tags.end();
A feature request always feels like a great excuse to work on nifty dbo !