SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

Can not create index #31

Closed tatapm closed 9 years ago

tatapm commented 9 years ago

Here is sample json: { "collectionId": 9999, "collectionStatus": { "id": 9999, "discoStatus": 4
}, "strasse": "abc" } 1.Create index for collectionId field with request :/collection/_indexes/collectionId ==> Error: "java.lang.NullPointerException", " at org.restheart.handlers.indexes.PutIndexHandler.handleRequest(PutIndexHandler.java:62)"

2.How to index collectionStatus.discoStatus field?

Thanks

ujibang commented 9 years ago

You need to PUT /db/coll/_indexes/indexname

The following json

{ keys: {"collectionStatus.discoStatus": 1} }

tatapm commented 9 years ago

Yeah. It work as your solution b/c I missed json body for those requests. Thanks