Doctrine Mongodb Search in a hashed field

I have a collection of books where each book has many categories.It looks like this:

{
    "_id" : 52,
    "reference" : "13168698",
    "title" : "PHP Code quality",
    "categories" : {
        "0" : "software",
        "1" : "php",
        "2" : "unit testing"
    },
    "createdAt" : ISODate("2020-08-14T07:03:16.000Z")
}

I want to be able to search for books by a single or multiple categories.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *