It would be a good idea to have common/models/model.json implement an index key as a part of the property you wish to be indexed. So when for example that document gets created in memory or in database, it also gets indexed.
...
"properties": {
"username": {
"type": "string",
"required": true,
"index": true
},
...
It would be a good idea to have common/models/model.json implement an index key as a part of the property you wish to be indexed. So when for example that document gets created in memory or in database, it also gets indexed. ... "properties": { "username": { "type": "string", "required": true, "index": true }, ...
Take a look at https://github.com/mongoosastic/mongoosastic, a cool library that does this for Mongoose.