1
I have a structure in mongoDB that has quantities of different items within an array called "items". To do the search, I am using the command below, which first transforms the content into a string, because below this.items there is a different structure, depending on the object:
db.getCollection('docs').find('JSON.stringify(this.items[0].value).toLowerCase().indexOf("tex")!=-1')
My problem is that since I don’t know how many items in each document, I would have to use a wildcard like this.items[*]. value, but that doesn’t work.
Does anyone know any solution, or has another idea for it?