I have a structure in mongoDB that has different quantity of items inside an array called "items". To do the search, I am using the command below, which first transforms the content into 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 do not know the amount of items in each document, I would have to use a wildcard type this.items [*]. value, but that does not work.
Does anyone know of a solution, or do you have any other ideas?