mongodb - Doctrine2 ODM - Object ( or Embedded Document ) as _id -
i have process running incremental map reduce collection looking @ metrics on different time periods - grouping id(s) , date. output collection has composite id handle grouping.
{ "_id" : { "site" : 67, "dt" : isodate("2012-07-03t00:00:00z") }, "value" : { // metrics here } }
i want able fetch results collection in symfony2 app using odm - having trouble _id
field. thought might able specify @id
, @embedone
:
/** * @mongodb\id * @mongodb\embedone(targetdocument="reportid") */ protected $id;
however, doesn't work. tried setting @id
strategy=none
, , can use querybuilder fetch rows, errors when trying hydrate document class. tried slugging site id , date ( 67-134137916
) , allows me use documentmanager, lose ability query date ranges.
anyone have input on how handle object id in doctrine2's odm, supported?
edit: removed composite primary key tag - question pertains using object primary key.
i'm not sure if gets @ heart of question: composite primary keys tutorial
it looks can have composite primary keys of integers , strings (so no dates?).
Comments
Post a Comment