2

I want to retrive record which are matching to booking's client id & want to show it to client. I am doing the following:

$mongoDb = $mongoDb->selectCollection('booking');
$bookingInfo = $mongoDb->find(array("client.id" => $_SESSION['client_id']));

My mongo database record looks like this:

  "paymentDue": "",
  "client": {
  "contacts": [
  {
    "name": "loy furison",
    "email": "[email protected]"
  }
],
"id": "5492abba64363df013000029",
"name": "Birdfire"
},

want to fire the query with key value as client.id in find function. But this query doesnt work..whats the issue

1
  • the mongocursor i am getting doesnot show the match record Commented Dec 18, 2014 at 10:49

1 Answer 1

1

I got a little logic that is different by key name only. If i find it with client.name then i shows me records & there i need to insert these in json object & then through foreach loop each record if i retrive & compare then it works...got it but the expected doesnt work why?????...didnt get:-!

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.