1

I am trying to implement find() query in php. I have the following geoJSON :

{
                "_id": {
                    "$oid": "dfgdg35g4334fwvwe34f"
                },
                "type": "Feature",
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        12.12345678910111,
                        3.12345678910111
                    ]
                },
                "properties": {
                    "name": "Any Name"
                }
}

and querying as

$cursor = $collection->find(array("geometry"=> array("type"=>"Point")));

to get the results from geometry->type="Point" . What am i doing wrong cant seem to figure out the problem.

1 Answer 1

1

Once you get the cursor from the result of the query, you have to loop through the cursor ($cursor) in something like a foreach. Let mw know if you're able to solve the problem.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah i was able to solve the problem last year, did the same thing u said. Thanks

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.