I'd like a class that stores a structure such as this:
{
name: "blabla",
metaData: [ {a: "mya"}, { a:"mya2"} ]
}
`
Now, I would like to have an index over the metaData[?].a fields.
- What is the best way to represent this metaData in a schema? As an embeddedList?
- Is it possible to have that index i want?
- If so, who should the query for retrieving an entity by it's "a" value should look like?
- Alternatively, if we have, instead of that metaData, a field called "myAs" that is a simple array of string - would it be easier?
Note that i'm using the Node.JS oriento library.
I don't know if the index you want is possible, but if you do what you say in point 4, it's possible to define an index (I defined it as unique, but others will work).
You could:
The query you asked in point 3 might be something like:
UPDATE
You can also index an embeddedmap. (See here)
The query to use such index should be: