Lionel
Lionel

Reputation: 596

usergrid set type column

Is it possible to insert set type data (column) in usergrid (as cassandra support set type column). I tried

curl -XPOST http://localhost:8080/<org>/<app>/<collection> 
                -d '{"name":"1974", "category":{"a","b","c"}}'

but it reply json_parse error.


Response to answer: I knew that payload in above request isn't valid JSON, I only tried to tell that is there any way I could make set type column (I need to prevent duplicate entries on single column record). with square brackets, It create list type column which don't prevent duplicate entries.


One of core member reply that on current Version (1.0), usergrid don't support set type column.

Upvotes: 1

Views: 57

Answers (1)

brandonscript
brandonscript

Reputation: 73005

It certainly is - but your payload isn't valid JSON; in JSON, you use square brackets to specify an Array: [].

Try instead:

curl -X POST http://localhost:8080/<org>/<app>/<collection> 
            -d '{"name":"1974", "category":["a","b","c"]}'
#                                          ^           ^

Upvotes: 1

Related Questions