I know how to store a simple Product Object in mongodb using symfony2:
This YAML file :
Acme\StoreBundle\Document\Product:
fields:
id:
id: true
name:
type: string
price:
type: float
Will produce this collection :
{
"_id" : ObjectId("..."),
"name" : "...",
"price" : "..."
}
But now, I would like to know how to write something generating a structure like that :
{
"_id" : ObjectId("..."),
"name" : "...",
"price" :
{
"before" : "...",
"after" : "..."
}
}
Any idea or documentation link ?