I need to store integer and string values in one field. What type should I use in mapping? When I use string, I get integer values as string in my mongo documents.
1
votes
2 Answers
2
votes
Just use @ODM/Field(type="raw")
annotation :
https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/basic-mapping.html#doctrine-mapping-types
/**
* @ODM/Field(type="raw")
*/
protected $value;