Questions tagged [php-mongodb]

MongoDB driver: PHP Extension for Mongo DB

Unlike the mongo extension, this extension supports both PHP and HHVM and is developed atop the » libmongoc and » libbson libraries. It provides a minimal API for core driver functionality: commands, queries, writes, connection management, and BSON serialization.

Userland PHP libraries that depend on this extension may provide higher level APIs, such as query builders, individual command helper methods, and GridFS. Application developers should consider using this extension in conjunction with the » MongoDB PHP library, which implements the same higher level APIs found in MongoDB drivers for other languages. This separation of concerns allows the driver to focus on essential features for which an extension implementation is paramount for performance.

168 questions
0
votes
1 answer

How to write Mongo Geospatial query in PHP?

I have a geospatial query Like Follwing Query.. This Query return 4 Records.. I want to Frame Following Query in PHP db.master.find({ location: { $geoWithin: { $centerSphere: [ [ 94.60867254, 27.54018825 ], 10 / 6378.1 ] } } }) How to…
Balakumar B
  • 770
  • 5
  • 17
  • 41
0
votes
1 answer

Parse Error in MongoDB aggregation in PHP

I'm getting an error when I'm trying to execute a MongoDB query in PHP. Parse error: syntax error, unexpected T_DOUBLE_ARROW in fiename.php on line 55 $findCount = array("$group" => (_id => "$createdby", count => ($sum:1))); //Line 55 $cursor =…
0
votes
0 answers

Upsert using multiple key search

I have the following mongodb structure { "_id" : 18536, "billing" : { "patientinfo" : { "patient_id" : "120196" }, "billinginfo" : { …
srikanta mondal
  • 119
  • 2
  • 15
0
votes
1 answer

MongoDB "imported data" not getting retrieved from PHP

I am importing a CSV file into my Mongo collection and it is getting imported successfully. This is my Windows Command Prompt execution: mongoimport --host localhost --db testing --collection test1 --type csv --headerline --file…
rogue12x
  • 3
  • 3
0
votes
1 answer

Add new member in mongo and preventing the error exception in application

I have three instances on EC2, each one with service mongo, set up with replica set, ie, a primary (192.168.1.1), a secondary (192.168.1.2) and an arbiter (192.168.1.3). I have several applications that connect with mongo. My question is as…
0
votes
1 answer

Number type managment in new MongoDB driver for PHP

Old driver has datatype wrappers MongoInt32(), MongoInt64() How to specifiy int lenght in new moongodb driver? http://php.net/manual/en/set.mongodb.php
Hett
  • 3,484
  • 2
  • 34
  • 51
0
votes
1 answer

Not able to pass array as argument inside find method

I have this code: require_once __DIR__ . "/vendor/autoload.php"; $collection = (new MongoDB\Client)->google_api->threadContents; $document = $collection->find(["messages.payload.headers.value"=>"kruno@ulix.com"]); echo…
Kunok
  • 8,089
  • 8
  • 48
  • 89
0
votes
1 answer

php connection error with mongo replica set

I have 3 instances on EC2, each with elastic IP, and each running mongo version 3.2. All are in the replica set by the type name. The bind_ip settings in mongod.conf are configured with the IP 0.0.0.0. I'm trying to connect mongo through php. I…
0
votes
3 answers

Mongodb Multiple and statement using PHP code

I want a query like the following from mongodb using PHP code: select * from orders where mrn=1234 and status!=cancelled and status!=delivered and status!=draft I have tried the following code which is not working: $filterpatient =…
srikanta mondal
  • 119
  • 2
  • 15
0
votes
1 answer

PHP MongoDB Record Searching Issue

I have MongoDB Collection with following data MongoDB Enterprise > db.UCODEPatter.find() { "_id" : { "UCODE" : NumberLong("233220524641368") }, "value" : 117 } { "_id" : { "UCODE" : NumberLong("233222325602424") }, "value" : 71 } { "_id" : {…
Kavinda
  • 177
  • 2
  • 12
0
votes
1 answer

Trying to add extension=mongodb.so in php --ini files

Installing mongodb with pecl for php. Running this command : echo "extension=mongodb.so" >> php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||" and its throwing permission denied exception like this :- bash: php --ini | grep "Loaded…
arslan
  • 11
  • 2
0
votes
1 answer

How to write a find query with condition in php-mongodb?

I'm having problem with find query in php-monogodb. find() without conditions works fine but when using condition inside find() method it won't give any results. How to solve this issue? $connection = new Mongo(); $db =…
Vaibhav
  • 45
  • 6
0
votes
0 answers

Find value in nested object in MongoDB

I have a MongoDB collection with following structure: "speed": { "m198": [ { "speed": ["60","150"], "channels": { "push": { "timings": { "from": "00:00", …
Shekhar Chikara
  • 3,786
  • 2
  • 29
  • 52
0
votes
1 answer

PHP MongoDB query dynamic values

I want to query the content (text) inside my dynamic values keys, but i can't figure out the easiest way to do this. So my mongo collection is like this: { "_id" : ObjectId("566aecb8f0e46491068b456c"), "metadatas" : [ { …
psychok7
  • 5,373
  • 9
  • 63
  • 101
0
votes
0 answers

PHP MongoDB GridFS support

I'm using MongoDB's GridFS for saving files, but i noticed deprecation notice here on http://php.net/manual/en/mongo.installation.php and to use the new MongoDB driver. But I dont see any documentation for GridFS in that new driver. Does he lack…
user3018350
1 2 3
11
12