0

I have a cloudant nosql db with some records like this:

{
 "role": "utente",
 "nome": "Rocco",
 "cognome": "Di Vitto",
 "team": "sap pm-cs",
 "company": "wrestling",
 "appManager": "john Ford",
 "teamLeader": "Rendy Orton, Colombo M.R."
}

I would like to query my db with a $regex the teamLeader field, passing a single string that matches either with "Randy Orton" or "Colombo M.R." but I can't figure out the regex for matching two comma-delimited strings. I've tried reading Erlang queries structure but I didn't find the solution. Some help would be very useful. thanks in advance

3
  • Do you mean this Commented Feb 8, 2018 at 10:59
  • 1
    Not seeing the perl in this question. Commented Feb 8, 2018 at 11:30
  • i composed this query { "selector": { "teamLeader": { "$.+(?|(Colombo M\.R\.)|(Rendy Orton)).+" : "Randy Orton" } } } but it didnt worked. Commented Feb 8, 2018 at 11:40

1 Answer 1

2

when supplying regular expressions you should be using the $regex operator. have you tried something like this:

{
   "selector": {
      "teamLeader": {
         "$regex": "(Colombo M.R.)|(Rendy Orton)"
      }
   }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.