I'm not sure what I'm doing wrong, but with MongoDB and PHP i'm trying to do this:
$db->textures->remove(array("_id"=>$_GET['texture_id']),array("safe" => true))
But nothing happens. I did a print_r and it says:
Array ( [err] => [n] => 0 [ok] => 1 )
...
I am working on a project where I want to have the ability to specify that certain nodes of the replica set can never be primary nodes ie in case of a failure where all primary capable nodes die the system should be reduced to a read-only state till some primary capable node comes up. Is this possible? If yes how? If not what is the best...
Instead, it displays this:
^[[A^[[A
...
con = pymongo.Connection('localhost',27017)
db = con.MouseDB
post = { ...some stuff }
datasets = db.datasets
datasets.insert(post)
So far, there are only 3 records, and it's supposed to have about 100...
...
How can I specify which fields to return in a group() query? find() has fields parameter; group() doesn't.
...
I have an array of key values
{val1:
[{gender:male}, {age:23}, {favorite-color:red}]
}
The thing about this array is that in no way is it structured and in no way am I ever guaranteed to see the same key value again. For example I could see the following for val2
{val2:
[{sex:male}, {hair-color:red}, {height:6'1"}]
}
My quest...
for post in db.datasets.find({"loc":{"$near":[50,50]}}).limit(10):
How do I get the distance between the document and "50,50"?
...
I am looking for a node.js framework which is capable of tracing user sessions via cookies/storage on the server side.
Storage has to be in MongoDB
...
db.mycollection.find(HAS IMAGE URL)
...
Im using the MongoDB Java driver in a java web app. One question I want to ask is do i run Mongo.close() whenever Im doing doing a query , or can I keep it open and run other queries on it and close it when my application ends.
...
Hello,
I am getting multiple similar JSON object from a remote site and looking to store them in a local MongoDB.
What would be the best way to do this ? (Preferably via Mongoid or Mongo-mapper gems)
Thanks
...
Hi,
I have a mongodb object as follows:
array (
'_id' => new MongoId("4cc97fb0247ae8747ec5fefb"),
'posts' =>
array (
0 =>
array (
'comment' => 'Eamorr',
'fromUname' => 'Eamorr',
'time' => 1288273840,
'UTC' => '2010-10-28T14:50:40+01:00',
'ip' => '127.0.0.1',
'id' => '123lasdfiqwoei28a...
In MongoDB, if I were to store an array (say "red", "blue") in a field "color", does it index "red" and "blue" so I could query for "red", for example, or does in make {"red", "blue"} a composite index?
...
Im having serious issues converting mongo id from object to string. The following code
$cursor = $connection->mydb->collectn->findOne();
var_dump($cursor['_id'].'');
var_dump((string) $cursor['_id']);
returns string(12) "Object id #6" while what I was expecting is a textual representation of the hex digits of the id. It however wo...
How connect to different db depending on @request.host value?
Using Sinatra and MongoDB with Mongoid.
I need to read a Sintra application's menu, data ... from different databases. I wish to deploy it only in one place and depending on request.host(subdomain) value to serve the specific pages.
...
In a MongoDB database, I have a collection of items, and each item stores its creation date. I need to query this collection by date. I tried:
db.items.findOne({date:{new Date(1285947037*1000)}})
but it isn't returning anything. I got that timestamp using PHP ($date->sec, where $date is a MongoDate object from the database). So wha...