Simple question :
I am using mongoDB
, Symfony 3.4
, and the DoctrineMongoDBBundle
.
How can I create a value in an mongoDB
entity that is an array of entities
For example : Have a conversation entity with a value message in it that is an array of entities message
Example in json
:
{
"id_of_the_conversation": 367,
"messages": [
{
"id": 1,
"content": "Hello i need help !",
"send_by": 34,
"received_by": 22
}
{
"id": 2,
"content": "Stack stack",
"send_by": 22,
"received_by": 34
}
{
"id": 3,
"content": "Maybe someone ?",
"send_by": 34,
"received_by": 22
}
],
}