I am just getting started working with CouchDB.
We have a database where the documents look like:
"_id": "43538c8409dd",
"_rev": "123",
"audit": false,
"members": {
"users": [
{
"dn": "cn=newuser1,ou=people,dc=foo,dc=com",
"dateAdded": "2020-12-02T16:52:41:748Z"
},
{
"dn": "cn=newuser2,ou=people,dc=foo,dc=com",
"dateAdded": "2020-12-02T16:52:41:748Z"
}
],
"groups": []
},
.
.
.
}
I am trying to find all documents in the database that contain (for example) "dn" with value "cn=newuser1,ou=people,dc=foo,dc=com".
I have tried a selector like:
"selector": {
"users": {
"$elemMatch": {
"dn": "cn=newuser1,ou=people,dc=foo,dc=com"
}
}
}
}
I know that there are several documents that should match, but I am getting "No Documents Found".
Can someone tell me why this search is not working?
Thanks, Jim