MongoDB is a document oriented NoSQL database. MongoDB supports journaling, datacentre-aware replication and auto-sharding to guarantee high availability. The database manages collections of BSON (a superset of JSON) documents. The major distinction between NoSQL and SQl is that NoSQL allows you to ...

learn more… | top users | synonyms

0
votes
0answers
11 views

YAML to DB CRUD with PHP?

I want to have a simple form with PHP that takes YAML code as an input and stores it in to MongoDB when submitted. The update of records should also happen in the same way with editing yaml codes. I ...
0
votes
1answer
42 views

Installing php mongo driver on AWS Elastic Beanstalk

I am trying to deploy a php application on Elastic Beanstalk. Everything is working fine except from my calls to the mongo driver. My attempt to install it followed these steps (unsuccessfully): ...
0
votes
3answers
35 views

Mongodb php compound query returns nothing

I have the following array: Array ( [data.cars] => 44 [data.xp] => Array ( [$gte] => 100 [$lte] => 500 ) [data.money] => Array ...
3
votes
1answer
95 views
+100

MongoDB Cross-db DBRef's in 2.4

I'm running MongoDB 2.4.6 locally and the MongoDB PECL extension is 1.4.3 while testing this. I'm currently working on an app that has two MongoDB databases, one called nc_main with a collection ...
0
votes
2answers
28 views

How to run multiple linux command using PHP

is it possible to run multiple linux command using PHP. I am using Mongodb database and if I want to import multiple collections, I am running the following command for each collection individually. ...
-1
votes
1answer
22 views

MongoDb replacing a document and inserting when non-existant

I want to replace a document when this already exists and if it doesn't I want it inserted. How can I do that in mongoDb? I need something like this, but in one query: find by a "where statement" ...
0
votes
1answer
20 views

missing value on upsert of an embedded array

I am playing with mongodb (2.4.7 64bit Linux OS) to figure out if it would be a great replacement for a existing mysql database. Pretty neat is the upsert functionallity - but I have a problem here. ...
-1
votes
1answer
37 views

How do I using Mongo aggregation to get the total “page views” for each group of days

I have tried for a few days now to come up with a working aggregate but I'm just not getting it. I have a collection that looks similar to the following. _id: ObjectId("52672ca368a56f481d000045"), ...
-2
votes
1answer
46 views

Confuse in choosing Big Database

I am aware with mySql. But i am new with Big Database. Just i started RND on that. I have to use amazon webservices with BIG database. Now my questions is that .. I am confuse with Big database ...
0
votes
1answer
38 views

MongoDB update query where field name has a DOT (period) in it

So before I ask the question I want to say I do know that Mongo doesn't allow period i.e dot (.) in the field name. The surprising part is that PHP was able to insert data to mongo with period in it ...
1
vote
0answers
35 views

Maximum size of MongoDB insert

I'm inserting a document in Mongo from PHP. I get the following error Uncaught exception 'MongoException' with message 'insert too large: 16458711, max: 16000000' But the Mongo documentation says ...
0
votes
3answers
29 views

Multiple push with reduce() in PHP MongoCollection->group()

I need to understand a MongoCollection->group() feature. PHP manual for group() states what follows: <?php $collection->insert(array("category" => "fruit", "name" => "apple")); ...
0
votes
1answer
44 views

Algorithm for optimising compound index search in MongoDb

I have a collection X on which I have to apply a filter. The filter is saved as a sepparate entity (collection filters) and the only data it holds are the field name and the conditions applied to ...
1
vote
1answer
120 views

Mongo+PHP Querying nested (embedded) documents excluding fields +'Where' clause

Trying to query nested documents(message collection) with embedded fields from an other collection(user) here it is an example of the document i want to query: array ( '_id' => new ...
0
votes
1answer
39 views

MongoDB - PHP manual references approach suitability

MongoDB newbie here. I'm having the first approach on references, and my main doubt is if i'am using the appropriate strategy(manual references) for my situation. Working on 2 collections(user, ...
0
votes
1answer
114 views

Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so

I am new to mongodb. I just installed mongodb on our development (linux) server: I got mongodb to work on my console and I could load and save data, but when I wanted to install the PHP driver and ...
0
votes
2answers
56 views

MongoDB running command in lithium

I'm trying to run a full text search against some data that is stored in mongoDb using Lithium. Here is how I am trying to do it in my controller: $mongodb = ...
0
votes
2answers
128 views

Mongodb query specific month|year not date

How can I query a specific month in mongodb, not date range, I neeed month to make a list of customer birthday for current month. In SQL will be something like that: SELECT * FROM customer WHERE ...
0
votes
1answer
34 views

how to do multiple where with same field?

How to convert this script for mongoDB? select * from table where id > -1 and id in (4,5) I need to execute this query with two where conditions on the same field. This doesn't seem to work in ...
0
votes
1answer
35 views

Does the mongodb php driver require php5-dev?

I'm trying to install mongodb in a PHP environment. MongoDB itself is installed fine, I've run pecl install mongo, and added extension=mongo.so to php.ini; but my Laravel application complains that it ...
0
votes
2answers
102 views

uploading and retrieving files into mongodb with php

how can we upload & retrieve files into mongodb using PHP,by directly using a form...like uploading profile picture during registration. Please Can anyone send me the code?
0
votes
0answers
44 views

MongoDB shard with PHP mongdb driver for storing session is slow, why?

My company uses Php with php mongo driver connecting to a sharded (5) mongo DB. The main thing it does is to store web session. So there is lots of write. The shard key is the session id which is ...
0
votes
1answer
118 views

MongoDB UTF-8 matching

I'm using mongoDB and I'm using turkish alphabet. But when I try to match turkish characters, there is a problem. an example: my database includes these values: İngiltere, İtalya, Şampiyona. when I ...
0
votes
2answers
88 views

Reading data with .NET inserted to MongoDB with PHP

I have an unusual setup where I am inserting data into a MongoDB from a PHP site. The data is then read by .NET and served up as an API. After inserting a record (via PHP) the .NET API throws the ...
0
votes
1answer
20 views

how to query by values in MongoDB [closed]

My collection looks like: { "_id" : ObjectId("520c8976586f12c80900301d"), "IDENTITY" : "ae4ff1546ecfe6ce6e8ebb2d870d57fb", "NAME" : "Winmain Yao", "TYPE" : "COMPANY", "PUBLIC" : 1, "BACKGROUND" : ...
0
votes
0answers
42 views

MongoDB: $unset replaces with null?

I have an array stored in my document: "properties" : [ { "createdate" : 1375981035, "updated" : 1375981035 }, { ...
0
votes
1answer
113 views

Mongodb aggrgation function for sum of embedded documents not working

i get an error like Array ( [errmsg] => exception: the $unwind field path must be specified as a string [code] => 15981 [ok] => 0 ) While i used following query for given ...
0
votes
1answer
53 views

MongoCursor Positioning Infinite Scroll Application with PHP

I am needing to get an infinite scrolling REST API call going. I have a general approach, but I cannot seem to find the proper syntax for what I am trying to accomplish. Essentially, the Web-App ...
0
votes
3answers
50 views

Combining '$or' and daterange

I'm getting the following fault while trying to combine '$or' with date range using the MongoDB PHP Driver: Fatal error: Uncaught exception 'MongoCursorException' with message '$and/$or/$nor must be a ...
0
votes
2answers
31 views

Incorrect sort result when using $nearSphere

this sorted correctly when using directly db.users.find({currentloc : {$nearSphere : [115.22804,-8.69914]}}) but when execute from PHP, it look like sorted by _id $users = ...
0
votes
3answers
102 views

Querying sub array with $where

I have a collection with following document: { "_id" : ObjectId("51f1fd2b8188d3117c6da352"), "cust_id" : "abc1234", "ord_date" : ISODate("2012-10-03T18:30:00Z"), "status" : "A", "price" : 27, "items" ...
0
votes
1answer
105 views

PHPUnit Mock of MongoCollection class creating a _PHP_Incomplete_Class object

Today I came back to a project I have not touched for a while. It is a Zend Framework 2 project using MongoDB as its database. I decided since it had been a while to update MongoDB to the latest ...
0
votes
1answer
322 views

php & mongodb: using $addToSet w/ $each

This question is very similar to mine: Is there a way to check if one of the array entries contains a sub-array in MongoDB? However, in mine, i'm still getting problems with some updates. I'm getting ...
0
votes
2answers
58 views

Retrieve columns of Mongo collection in PHP

I tried the following: $mongo = new Mongo("mongodb://localhost"); print_r($mongo); $db = $mongo->test; // access collection $collection = $db->test; // execute query // retrieve all ...
4
votes
0answers
250 views

PHP MongoDB fatal error: Read timed out

sometimes there is a bug (~30%): Failed to connect to: IP:2333: Read timed out after reading 0 bytes, waited for 0.000000 seconds Web server Apache/2.2.16 PHP version PHP ...
1
vote
2answers
45 views

MongoDB (this OR that OR the other) but NOT (me)

I have an account document that looks like this: _id: ### email: string password: md5(string) altemail: [{ email: string verified: time}, { email: string ...
0
votes
1answer
52 views

MongoDB: If document exists VS If document does not exist

I'm a beginner at MongoDB and I'm currently pairing it with php to try to make the following work: I want to create a database to store information that can get updated at any time but it needs to ...
2
votes
0answers
1k views

Laravel 4 & MongoDB [closed]

I'm a Laravel's fan. Php generally & Laravel individually is a good combination with MySql. However, I have recently been interested in MongoDB's flexibility & simplicity. I want to refer ...
0
votes
2answers
83 views

Mongodb elemMatch alex bilbie library

i am using alex bilbie library for mongo db (https://github.com/alexbilbie/codeigniter-mongodb-library/tree/v2). I dont know how to form elemMatch query with this lib. I need to transform this to ...
0
votes
1answer
209 views

Issue with boolean query in mongo php

I need to perform a query based on the value of some boolean fields. These fields may not exist in some documents, as they were added at a later stage. I tested the query in the shell and worked ok: ...
0
votes
2answers
174 views

How can I add/insert to a subdocument array in CakePHP?

Ok, so I have done alot of searches on this site and Google and found some answers, but none of it has worked. I also have checked out @ichikaway's site and test procedures. Even the thing in there ...
1
vote
2answers
256 views

Mongodb update several documents with different values

i am trying to update several documents in mongodb with different values each. In mysql I do something like this: $objs = ...
0
votes
1answer
38 views

MongoDB keeps giving me null

I have some difficulty in getting Mongodb aggregate to work. It keeps giving me null. Please help. Below are the codes written in php. Thanks. What I want to do is to sum up the values of 2 fields, ...
1
vote
1answer
420 views

MongoDB Geospatial query result not getting in order of Distance

I am new to mongodb, trying to fetch result from mongodb using geospatial. With this ...
0
votes
0answers
110 views

mongodb php driver installation issue in redhat.

My server Os is redhat. I installed mongodb 2.2.3 version successfully in my server. i used this link for reference ...
0
votes
1answer
93 views

Locking in MongoDB for a Pintrest like website

One of our client projects is a Pinterest like website. It was made with MySQL and CodeIgniter some time back. As they have recently gotten funding and hopefully will get a lot more traffic. We are ...
0
votes
1answer
35 views

Expiring elements inside mongodb document

Note: First time using MongoDB. Technology: php mongodb Scenario: The data is suppose to hold programs offered. Document looks like: { LocationName: 'name of the location', LocationAddress: ...
0
votes
1answer
221 views

Slow (high latency) upon queries with sort mongoDB

I am currently migrating from couchdb to mongodb, still learning this stuff and have a problem anytime I do some queries with sorting in my webpage. I am using codeigniter as the framework and using ...
0
votes
0answers
138 views

Installing PHP Extensions for Mongo DB; problems with php.ini file

I installed mongodb (mongodb-osx-x86_64-2.4.3) and was then trying to add the extension libraries for php. Following the manual install instructions at ...
0
votes
1answer
188 views

PHP Mongo:command not found

I have been trying to use the mongo::command in PHP to build a MapReduce but every time I run my code I get the following error: PHP Fatal Error, call to undefined method "mongo:command" My Code: ...

15 30 50 per page