[00:12:44] <crackmonkey> I've got a really dumb, using-mongo-for-10-minutes kind of question. Can the $gt-style operators not be applied to nested documents?
[00:13:08] <crackmonkey> i want to do something like this: db.metrics.find({ heart: { beats: {$gt: 9} } }) but it gives me 0 results
[00:13:19] <crackmonkey> but if I do an exact search for 10, for example, I get a bunch of docs.
[00:14:59] <joshua> crackmonkey: You can use dot notation so you can do heart.beats
[00:15:34] <crackmonkey> joshua: I just found that, it works. It seems more like a "must" instead of a "can", though.
[00:17:13] <crackmonkey> is there a reasonable technical explanation for that, or just a weirdness of the tool?
[00:20:26] <joshua> Its been a while since I dealt with that kind of thing, so I can't really explain it myself :)
[00:22:11] <crackmonkey> heh, fair enough. thanks for the help.
[00:30:55] <greenie_> Hello. Is Mongo used (as a good practice) for small databases ever?
[00:31:27] <greenie_> I have begun using it for a project where the structure of each record can vastly differ, and it seemed much easier to do it with mongo than figuring out a relationsal scheme
[00:32:30] <greenie_> The number of records in each collection, however, isn't likely to climb above 5,000 or so
[02:52:11] <jayjo> I'm using mongoengine to work with mongo, and I've updated my model. I already have documents that now don't adhere to this new change. Do I use 'mongo' to interact with the db (write quick code to add a field based on other fields) or does mongo only provide a cursor?
[02:52:39] <jayjo> Or do I use a driver, say pymongo and do the work directly with that
[02:52:59] <jayjo> At this point it's only double digit documents, but in the future this could be a problem
[03:23:56] <jayjo> I think pymongo is the way to go for this task
[04:00:52] <jayjo> I want to update a document with a new field that depends on another field. Is there some sort of self equivalent?
[04:01:23] <jayjo> bulk.find({}).upsert({'$set': {'slug': slugify(self.category)}}) is what I'm after I think
[04:02:56] <jayjo> is forEach the only way to do this?
[04:14:30] <cheeser> yeah, you'll have to forEach()
[05:38:58] <Roots47> Hey guys, I just installed mongo db on an ec2 instance, and opened the TCP port 27017, but when I try to connect in my express app via mongoose.connect('mongodb://ec2-52-0-106-233.compute-1.amazonaws.com/dbname'); it fails to connect.
[05:40:00] <morenoh149> Roots47: specify the port number
[06:13:15] <morenoh149> ^ does the square bracket matter?
[06:17:13] <morenoh149> looks like array syntax is optional http://docs.mongodb.org/manual/reference/method/db.collection.aggregate/#db.collection.aggregate but necessary if you choose to also pass an options arg
[08:59:54] <esko> moin, i asked last night about updating a document if the array is empty, could someone help ;-), trying to grasp the basics.
[11:04:04] <Guest66200> joannac: i was inserting data into mongodb and even after i succesfully inserted them and created indexes,still 8 GB of RAM is used by mongodb process
[11:04:16] <joannac> how are you determining it is still using resources?
[11:04:47] <Guest66200> when i see windows manager i see it uses 6 GB of RAM
[11:13:18] <Guest66200> i just don´t get it,that´s why we are all learning to use effective data structures so we don´t have to read all the data in memory to find what we are looking for
[11:16:13] <Guest66200> isnt there any command i can force him to?
[11:16:38] <joannac> if another application says "i need memory", the OS will go "well that mongod process hasn't used its memory in a while, I'm going to take some off of it"
[11:17:02] <Guest66200> okay i tell you how imagined it would work
[11:17:20] <Guest66200> 1) Insert data,take the memory it needs to do it,tahts okay
[11:17:30] <Guest66200> 2) Free up the memory,data is stored on disk
[11:17:48] <joannac> okay. well your understanding is incorrect
[11:18:08] <Guest66200> 3) So no resources are used right now. When someone wants to look up something,take the up the memorz and keep it in memory for further use thats all right.
[11:18:40] <joannac> so in 3, you would rather wait for another disk read?
[11:18:47] <Guest66200> this is all wrong,because i need to restart the server to free up the memory and then its working like its supposed to
[11:19:10] <kali> Guest66200: it does not cost you anything to leave the data in virtual ram forever
[11:19:28] <joannac> it costs you nothing and can only give you benefits
[11:19:48] <joannac> in the worst case, you get zero benefit but also zero cost
[11:19:51] <kali> Guest66200: the kernel job is to provide you with as much virtual memory you ask, and then choose by itself what should be actually kept in physical memory or not
[11:19:59] <joannac> at the worst case, you keep reading from disk and writing to disk
[11:20:49] <Guest66200> joannac,kali: i had this on OS and i didnt understand it very well then,i got C,i still study. I know there is physical and virtual memory and that virtul memory is using some kind of 2 tables to calculate the place in the real memory.
[11:21:39] <Guest66200> joannac,kali: so i dont understand what it means when my OS-Windows is telling me right now i have 7,82 GB memory usage, i have total 12 GB
[11:23:13] <Guest66200> kali: how do i know if its in virtual memory or in physical? maybe thats the point where i am misudnerstanding this
[11:24:10] <Guest66200> kali: task manager says what i said to you,but i also know it was created for common user. is there any way i can actually know the answer for my question? please clarify me,i want to learn something,thats the point of all i have been doing,its my bachelor thesis :)
[11:24:17] <kali> Guest66200: you may want to read this: https://www.varnish-cache.org/trac/wiki/ArchitectNotes it talks about varnish but the memory management strategy is the same in mongodb
[11:25:41] <kali> and i'm sorry i really can't help with windows
[11:26:08] <mkode> is there a way to surpass 16 MB document size?
[11:30:14] <Guest66200> kali: okay i will read it,but i still dont udnerstand why windows says Available memory 4,2 GB,cached 3,8 GB,free 460 MB
[11:30:45] <Guest66200> kali: he says the opposite,that actually in Windows its all stored in physical memory,maybe now i get it why windows is so wrong
[11:36:12] <Guest66200> kali:now i am really confused
[11:40:50] <Guest66200> kali: okay now i understand how it works,its reasonable and its like you told me,thats what i wanted
[11:41:08] <Guest66200> kali: its just stored in virtual memory when the program is not busy
[11:41:23] <Guest66200> kali: i still need to figure out if its bug in windows task manager or what
[11:41:58] <Guest66200> kali: because this way i am really not sure if windows considers the application to be busy or i forgot something in my code,maybe,but i closed the session properly as i am aware
[11:44:20] <Guest66200> kali: hmm acording to some paper i have read he is really using 8 GB of physical memory
[12:14:50] <Guest66200> kali: are you here? i think i know what might be the problem. i am running the MongoDB as windows service
[12:15:38] <Guest66200> kali: can´t it be that he assumes the service needs to respond to clients so he keeps all in physical memory,he doesnt know that i am stupid admin who tries to insert and that needs not to be remembered
[13:17:08] <esko> hi guys! could someone help with a quickie.. im just starting out with mongo. http://pastebin.com/tzH88wfB i need to insert some placeholder value in the array that tags: document holds, if the array is empty
[15:04:17] <brano543> hello,anyone has an idea why mongod creates cursor for the whole data set after an insert and doesn´t close it after 10 minutes of inactivity like it should? Why does it allocate so much physical space?
[15:09:31] <brano543> i am closing the session after the session. Anyone has an idea?
[15:24:43] <brano543> anyone willing to help please?
[15:31:32] <brano543> I need to all the resources to be freed after i close the session. Is it possible?
[15:34:26] <brano543> its strange,i have even read the API documentation again and it says that after the session is closed it may be either put in the pool(i guess that virtual memory) or collected,depending on the case. I just dont udnerstand how this is the case for it to be collected. http://godoc.org/labix.org/v2/mgo
[17:27:34] <hahuang61> anyone know what this means
[17:27:46] <hahuang61> failed with error 13396: "error creating initial database config information :: caused by :: DBConfig save failed: { ok: 0, code: 25, errmsg: \"could not verify config servers were active and reachable before write\" }"
[17:29:20] <rc3> hi guys, need some pointers on how to do data grouping by N weeks (N>1). I know how to do it when N==1, my data is basically tick price information (OHLC) beginning from year 1999
[17:30:23] <rc3> I am thinking about doing weekly grouping first, then group by N weeks, first part is easy, later part is not
[17:32:02] <rc3> one alternative solution I've tried so far is to get the (rounded) week number based on a reference date in 1970
[17:32:39] <rc3> but that's can't guarentee the (grouped) dates fall on Fridays
[17:42:07] <rc3> see my alternative solution (which works but not perfect) at http://pastebin.com/uy3Ag0Yz
[17:47:57] <MacWinner> if i want to migrate a bunch of files that are organized into directories/subdirectories/images.png into gridfs, do I need ot create my own filenaming convention for concatenating the directories/subdirectories/images?
[17:48:26] <MacWinner> I don't seem to see the concept of folders or directories in gridfs. just want to confirm that's the case before I embark on reinventing the wheel
[18:12:02] <rc3> I think I nailed it, I just need to combined both methods (group weekly data first then use the alternative method mentioned above for N-week data grouping), final solution is here http://pastebin.com/n3HGdPhD
[18:35:21] <mrmccrac_> i have 36 shards in a cluster, and inserted 100,000 documents, any idea why the vast majority of them would go to shard1, and only a handful to shards 2-4? the remaining 32 shards never have docs inserted into them
[18:35:50] <mrmccrac_> all 36 are listed in a db.stats()
[18:36:50] <kali> mrmccrac_: how many chunks did it generate ?
[18:37:51] <mrmccrac_> 46 i think, 39 are in shard 0, 5 in shard 1, 1 in shard 2, 1 in shard 3
[18:38:33] <kali> mrmccrac_: look in the config database for the log collections. chances are the balancing is happening as we speak
[18:47:10] <mrmccrac_> only ever uses the first 4 shards out of 36 very suspicious
[18:47:54] <kali> try to find out which mongos has the balancer lock and see if it says something in its log, maybe
[18:52:30] <mrmccrac_> 2015-02-07T18:49:12.826+0000 I SHARDING [conn2] ChunkManager: time to load chunks for interface.data: 1ms sequenceNumber: 2 version: 4|28||54d3da8662b5d4bd3fd7ddc6 based on: (empty)
[18:52:48] <kali> i have no idea what this means :)
[20:45:17] <hahuang61> kali: would you have any insights on why this happens: https://gist.github.com/hahuang65/8e5761375806c3d048a0
[20:45:44] <hahuang61> kali: basicaly in the logs, it's really slow, and it scans a TON of objects, but in our explain, it's REALLY fast, and scans only 29 objects.
[20:45:51] <hahuang61> sorry in this case, it's 1 object
[20:46:13] <hahuang61> but we tried to explain() a bunch of queries in our mongod.log that look like this, and they ALL have very fast performance during the explain
[20:46:31] <kali> hahuang61: check if you're testing with the same sort() and limit() options
[20:52:20] <kali> that way, you'll get execution plan for the actual queries
[20:54:29] <hahuang61> kali: looks like there is no sort or limit in the log.
[20:55:05] <kali> ok, built-in profiler comes next i think
[20:56:14] <MacWinner> is it possible to include server specific configs into my main.cf? I have a couple parameters that a different between servers, but otherwise main.cf is the same.. I'd like to be able to sync the main.cf across servers without worrying about the server specific pieces
[21:07:45] <_John_W_> Should the contents of /var/lib/mongodb be mongodb.nogroup or mongodb.mongodb?
[21:08:09] <_John_W_> So you think that this may be a problem with MongoDB 2.0.4?
[21:09:20] <kali> well, i can't remember a time with chronic issues on shutdown/restart once journaling was there, and i was working with a full team of developper working with their laptops
[21:10:09] <kali> i don't think nogroup can make a big difference, as mongodb will run with mongodb
[21:10:35] <kali> just make sure you sudo to mongodb to perform the recover
[21:10:51] <_John_W_> Yes, I would think that if this were a problem with 2.0.4 that it would have been documented. I suspect it is something I did at some point.
[21:11:08] <_John_W_> If that is true, then upgrading will probably not solve the problem.
[21:11:44] <_John_W_> MongoDB was working fairly reliable two years ago when 2.0.4 was new and I know a number of instances where 2.0.4 is working reliable right now.
[21:12:00] <_John_W_> Despite your adivce, I would prefer to understand the probem before I upgrade.
[21:12:14] <_John_W_> I agree about the permissions. I was just looking for validation.
[21:12:48] <_John_W_> One more issue is that this is a protopyte applicaiton that I am running on my laptop so it gets shutdown a bit more than in a more traditional installation.
[21:13:02] <_John_W_> There is no sharding or replication in the prototype.
[21:13:35] <_John_W_> Meaning it is a very simple Mongo deployment and it is very vexing to not be able to diagnose what is going wrong.
[21:14:12] <kali> do you have a log output of a failed startup ?
[21:18:16] <kali> _John_W_: what happens when you shut down mongodb using the scripts ? does the /var/lib/mongodb/mongod.lock file disappear ?
[21:19:24] <_John_W_> Yes, when I do a manual shutdown either from the mongo shell or with upstart, all is well.
[21:19:54] <_John_W_> It only seems to have a problem when I rely on upstart to handle things automatically, which clearly I do all the time.
[21:20:35] <kali> _John_W_: can you check the log just before a fail restart ? is there the dbexit: really exiting now line there ?
[21:21:14] <kali> hahuang61: yes, sort in the shell translate to orderby modifier
[21:21:54] <_John_W_> No, the 'really exiting' line only appears when I do a manual shutdown.
[21:22:26] <_John_W_> That is why I was looking at the upstart script.
[21:22:28] <kali> and does the log mentions anything about shutting down ?
[21:22:38] <kali> because, yeah, it looks like a script issue from there
[21:23:28] <_John_W_> Yes, I agree. That is why I couched the problem in relation to Ubuntu and Upstart.
[21:23:51] <_John_W_> No, I have to go back to a clean shutdown in the log before I get the normal shutdown and really exiting messages.
[21:25:35] <_John_W_> The mongo upstart script looks like all of the other upstart scripts. It starts on runlevels 2,3,4 and 4 (even though 4 isn't used) and it shuts down on 0 and 6.
[21:27:39] <hahuang61> kali: looks like this is basically what we're seeing: https://jira.mongodb.org/browse/SERVER-13866
[21:27:49] <_John_W_> Do you think it is possible that the system shutdown outruns the MongoDB shutdown meaning that Mongo dawdles a bit after it gets the shutdown signal and the OS shuts down before it si done?
[21:33:01] <hahuang61> kali: thanks. still doesn't make sense to me with console explain works perfectly, wouldn't the optimizer cache which index to use across both so that it'd use the same index?
[21:33:57] <kali> hahuang61: i don't know. to be honest, i haven't gone in prod with 2.6, so i'm not completely aware of its isiosyncrasies
[21:34:27] <hahuang61> okay, thanks for paying attention to me and my ramblings :) much appreciated!
[21:50:56] <brano543> Hello. Can anyone describe me how the mongodb caching works? I need to insert a few millions of records,but they all get stored in RAM during the process and even after it succesfully inserts the last one.
[22:14:41] <brano543> Is anyone online? I need help with freeing up cached resources on every insert.
[22:29:35] <joannac> brano543: i have no idea what that means
[22:30:48] <joannac> do your few million records are stored in RAM... and you don't want them to be?
[23:03:21] <FunnyLookinHat> How do I free up the space this database is using? http://pastebin.ubuntu.com/10117051/
[23:03:33] <FunnyLookinHat> I did a db.[collection].drop() but the filesize is still huge
[23:10:25] <andreassaebjoern> Hi! Is there a way to load a related document when returning results in mongodb? I have embedded the id of the related document.
[23:10:56] <andreassaebjoern> I am interested in not have to query the database for the related document