[01:17:41] <danfinch> is it true that mongorestore with --collection and --drop will only drop the collection specified in the command line?
[01:23:44] <danfinch> and if I do not provide collection, does it only drop those which already exist at the destination?
[01:24:11] <cheeser> you'll want to test that one...
[01:24:29] <cheeser> import into a new db. create a new collection or two, then import with --drop and see
[01:28:40] <danfinch> will do, would like to see if someone who knows they know knows, too, since I can't find anything that clear in docs/basic googling
[03:34:02] <QS> any idea what's the best way to get running number of id?
[07:09:36] <shambat> I have a python script that loads in two large json files, this is causing my VPS to crash since all the memory is being used up. I would like to store these files in a database like mongodb instead. Is there a way to get mongodb to use disk instead of memory, or set a maximum or something? I am not as concerned with speed.
[08:35:57] <sweb> is it possible save same id on different collection ?
[08:36:37] <sweb> i have mirror collection ... latest_news and archive_news i want have all latest news on archive_news
[08:37:03] <sweb> for tiny collection on complex type of fetch and archive for regular fetch
[08:41:06] <rspijker> sweb: _id’s don;t have to be unique over collections
[08:41:49] <sweb> rspijker: is unique over one collection, so i can :)
[08:43:22] <rspijker> inside of a single collection it needs to be unique, yes. But if you have two documents, say a and b from collections A and B respectively. Then there is no objection to a._id == b._id
[09:45:04] <user123321> If I could open a mongo-db using robotmongo which has been hosted remotely, how to get that database up and running in my Ubuntu/LUbuntu host?
[10:31:06] <user123321> rspijker, how to get a copy of the mongo-db database which is hosted in mongolab.com? I can access it using robomongo. I'd like to host in my machine itself.
[12:16:48] <similian> should i be using mongo or mysql for the evaluation of apache access logs ( page visitors, pageview, referrer by unique visitor, aggregate unique visitors ... )
[12:18:01] <similian> ~ couple of 100 Gigs per month
[14:00:03] <Breaking_Pitt> Some advice on what's going on?
[14:02:22] <oceanx> hi, I wrote an aggregation pipeline, and the last step is a projection, I want to return only the content of one of the fields (which is a dictionary) is there a way to do so without having to return the full document or projecting every single field of the sub-document?
[14:14:47] <nacer> what do you thin about a shard with member with different memory size ? like node1 -> 64Go , node2 -> 64Go, node3 -> 16Go
[14:15:25] <nacer> in this case i will have a config that will prevent the node3 to become MASTER
[14:17:13] <adamcom> you can just set it to priority 0 to make sure it never becomes primary - I'd consider making it a hidden node also, that way you don't hit it for queries to the replica set (but you could send it queries directly)
[14:19:01] <adamcom> nacer: if you keep traffic away from it that might hurt it with the lesser RAM, and have it at priority 0, then you should be fine
[14:19:08] <nacer> adamcom: i want to know if someone is going to says "WARNING BAD IDEA" because ...
[15:14:16] <San1ty> Hi Guys, I´m stuck with a rather annoying issue that I can fix. I have two processes connecting to the same mongodb database but writing to two separate collectiosn. the process write to their respective collection every 10 seconds.
[15:14:28] <San1ty> Now at sporadic moments both my process exit at the same time with the following error
[15:19:59] <San1ty> with the same error but with a different objectId
[15:20:07] <rspijker> what does your insert look like?
[15:20:23] <San1ty> it´s written in node.js just a sec
[15:21:30] <_rgn> if I embed "user" document originally in users coll, to another document, what is the ObjectId typically called in the subdocument, simply _id?
[15:22:38] <rspijker> _rgn: unless you have a good reason to call it something else, that shouldn;t be a problem
[15:24:19] <San1ty> rspijker, I´doing a bulk insert of a couple of entries collection.insert(entries, function(err) {
[15:24:42] <rspijker> what do your entries look like?
[15:26:13] <San1ty> rspijker I let the ID be autogenerated and the rest are just a bunch of numbers with one field being a timestamp
[15:26:51] <San1ty> rspijker, i´m using mongojs as a rapper for the mongoDB API https://github.com/mafintosh/mongojs
[15:28:34] <rspijker> maybe the node driver doesn’t handle it correctly or something...
[15:28:57] <San1ty> just doublechecked both process error out on the EXACT same second
[15:32:52] <rspijker> well… you could generate an ObjectId in the driver instead of having mongod do it
[15:33:12] <rspijker> apparently this guy had a similar issue: http://stackoverflow.com/questions/16133602/during-insert-e11000-duplicate-key-error-index
[15:33:32] <rspijker> I’d say, try that. Not sure why it would happen in the first place though...
[15:36:56] <San1ty> yeah that´s what I think as well
[15:37:55] <rspijker> Only thing I could think of is that mongo thinks the just deleted _ids are now available again, but they’re still in the index or something… Moving the id creation to the driver should sort that. But it’s a stretch anyway
[15:42:13] <user55> Hello! I would like to ask a question, about finding and matching embedded arrays, array items.
[15:42:16] <user55> We need to represent a tree structure in mongo.
[15:45:38] <rspijker> user55: the only real problem I see is ordering…
[15:45:44] <rspijker> your paths are ordered, arrays are not
[15:47:11] <user55> rspijker: can you suggest a different kind of solution?
[15:47:13] <rspijker> easiest solution to that I can think of is making your ancestor array an array of documents instead of strings. Where each document has the name of the ancestor and the level
[15:48:46] <rspijker> your example: {path:[{n: path, l:5},{n:to, l:4},{n:resource, l:3},{n:one, l:2}], resource: “I am a resource”}
[15:49:10] <rspijker> in this case I made the levels relative to the resource, that might not be the best option
[15:49:56] <kali> it might be enough to store the position (l) only once, as the position in the immediate parent
[15:50:33] <rspijker> I’m assuming you;ve also considered this model: http://docs.mongodb.org/manual/tutorial/model-tree-structures-with-materialized-paths/
[15:50:46] <kali> so you store the path array (provide breadcrumbs and subtree search) and the position in the parent in each doc
[15:51:49] <user55> rspijker: of course, that was the basic source of the idea
[15:51:51] <rspijker> the path array approach does impose some limitations… you can’t have the same resource name in different locations without breaking things
[15:53:43] <user55> what about this: {path:[{1:path},{2:to},{3:resource}], resource: “I am a resource”}; is this valid?
[15:54:05] <lfamorim> adamcom, how I put the index on memory?
[15:54:35] <rspijker> user55: it’s valid… not sure if it’s the best…
[15:54:43] <rspijker> you can’t easily query on field names
[15:56:21] <rspijker> user55: so, what was the reason for not choosing that materialized path approach?
[15:57:37] <rspijker> the two queries you find important can be optimized with an index. And the ones you find less important can be supported as well (though not as fast)
[16:05:48] <lfamorim> Hello! Someone knows why this query took so long to run on Mongo 2.6? http://pastebin.com/1CdWtHQF https://stackoverflow.com/questions/24697892/slow-indexed-query-whats-wrong?noredirect=1#comment38300178_24697892
[16:53:31] <oceanx> this is how my document looks like
[16:53:57] <oceanx> I need to get only the "levels" which are enabled
[17:58:39] <lfamorim> Someone know why this query took this long to run? http://pastebin.com/h8auApjS 1,287 sec
[18:02:08] <zhodge> I have a db of logs and right now a redundantly named collection called logs which stores log documents that all have a `type` property distinguishing certain logs from others
[18:02:20] <zhodge> would it make more sense to simply have those distinct type values as collections?
[18:21:19] <jchamberlain> in PHP, is it possible to return a query result as a json string instead of an array?
[18:29:09] <QS> i tot u could always do a json_encode?
[18:36:57] <sebastian_o|> hi guys, what you consider good API design when your API needs to answer a create when the object already exists? bad request? server error? or a 200 with a false in payload?
[19:02:16] <lpin> you could take a look at what popular APIs return for conflicting resources like github, twitter etc.
[19:03:13] <sebastian_o|> good point! github returns 409, they say
[19:03:40] <sebastian_o|> "Git DB API functions will return a 409 Conflict if the git repository for a Repository is empty or unavailable. This typically means it is being created still. Contact Support if this response status persists."
[19:47:52] <tscanausa> luis_alen: you could run mulitple instances on a single server
[19:48:22] <luis_alen> tscanausa: yeah, I think that's what I'm going to do.
[21:44:20] <styles_> Can I use aggregate to count all the words in all sentences in a collection?
[21:44:32] <styles_> I am doing it with map reduce right now, but I'd like to try the aggregate framework if possible
[23:38:57] <travisgriggs> i have a test/prototype mongodb on a 32 bit linux install. i have a new 64 bit linux machine running mongo now… is there an easy way to copy the data from the one to the other. i’m getting createPrivateMap errors on the 32 bit machine, so it seemed time to remove the 32bit as a potential problem
[23:40:02] <travisgriggs> i assume it’s not as simple as copy the /var/lib/mongodb directory (that would be the cat’s meow if it WAS that easy…)
[23:55:00] <travisgriggs> ok, i found mongodump, but i can’t even get it to run. i get the open/create failed to createPrivateMap error. anyone know how i can diagnose/fix that error?