I am trying to query in couchDB to filter with code ='hi'
{
id:1,
linked": {
"type": "XX",
"code": [
"hi",
"hello"
]
}
This is how I am trying:
{
"selector": {
"linked": {
"type": "xx",
"$elemMatch": {
"code": "hi"
}
}
}
}
I am not getting output.Can anybody help
If I understand the intention of your query correctly, I think you mean:
{
"selector": {
"linked.type": "XX",
"linked.code": {
"$elemMatch": {
"$eq": "hi"
}
}
}
}
$elemMatch
operator was specified incorrectly. See the docs here