This is what I'm sending: -
curl -X POST -H 'Content-type: application/json' -g $COUCH_URL/$COUCH_DATABASE/_find -d query.json
and this is what I'm seeing: -
{"error":"bad_request","reason":"invalid UTF-8 JSON"}
I checked my query: -
cat query.json
{
"selector": {
"$or": [
{
"givenName": "Maggie"
},
{
"givenName": "Lisa"
}
]
},
"fields": [
"givenName",
"familyName"
],
"sort": [
{
"givenName": "asc"
}
]
}
"selector": {
"$or": [
{
"givenName": "Maggie"
},
{
"givenName": "Lisa"
}
]
},
"fields": [
"givenName",
"familyName"
],
"sort": [
{
"givenName": "asc"
}
]
}
and it looks OK.
Thankfully, this chap had already hit the same: -
Yep, that's exactly where I went wrong ….
I changed my query: -
curl -X POST -H 'Content-type: application/json' -g $COUCH_URL/$COUCH_DATABASE/_find -d @query.json
and … guess what ….
and … guess what ….
IT WORKED
{"docs":[
{"givenName":"Lisa","familyName":"Simpson"},
{"givenName":"Maggie","familyName":"Simpson"}
],
"bookmark": "g1AAAAA9eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYozGoIkOGASOSAhkDibb2J6emZqVhYA5ooQDg"}
Can you say "Doofus" ? I bet you can ….
{"givenName":"Lisa","familyName":"Simpson"},
{"givenName":"Maggie","familyName":"Simpson"}
],
"bookmark": "g1AAAAA9eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYozGoIkOGASOSAhkDibb2J6emZqVhYA5ooQDg"}
Can you say "Doofus" ? I bet you can ….
No comments:
Post a Comment