Actions
Feature #882
closedmethod of dbo::collection to test whether object belongs to collection
Start date:
06/30/2011
Due date:
% Done:
0%
Estimated time:
Description
Hello!
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
if(p->tags.has(cooking))
Updated by Boris Nagaev over 13 years ago
Sorry, it is not a bug, but a feature :)
Updated by Koen Deforche over 13 years ago
- Assignee set to Koen Deforche
Hey Starius,
A great feature!
To be STL compliant, that would need to be either (or both):
p->tags.count(cooking) == 1
or
p->tags.find(cooking) != p->tags.end();
A feature request always feels like a great excuse to work on nifty dbo !
Regards,
koen
Updated by Koen Deforche over 13 years ago
- Status changed from New to Resolved
- Target version set to 3.1.11
I've implemented this syntax:
p->tags.count(cooking) == 1
It also takes into account natural (and composite IDs).
Regards,
koen
Updated by Koen Deforche about 13 years ago
- Status changed from Resolved to Closed
Resolved in Wt 3.1.11
Actions