[02:46:37] <bchgys> Hi folks. Trying to do this: db.collection.update({phrase: phr}, {{$addToSet: {posts: fred._id}},{$inc: {count: 1}}},{upsert: true}); in mongo shell. Getting 'unexpected token {' error. Can I not do $addToSet and $inc in the same query, or is there something else that I'm missing?
[03:19:37] <UnNaturalHigh> I was wondering if anyone here can help me figure out how I might make it such that I have two fields index_name and date they together they both must be unique, but can individually be the same?
[05:43:06] <FurqanZafarIQ> nodejs mongodb driver drops connection when idle
[06:06:43] <joannac> FurqanZafarIQ: even after turning on keepalive?
[06:07:41] <FurqanZafarIQ> no i didnt try keepalive. i am connecting to the db and storing a reference to it in a global variable
[06:07:50] <FurqanZafarIQ> every future request then uses this variable
[06:08:29] <FurqanZafarIQ> but when the server receives a request after 3 or more hours, the insert request fails silently or sometimes throws an error (unable to connect)
[07:51:55] <lqez> Faisal_: If you could make a http://runnable.com/ for this problem, it's much better to examine together
[07:52:55] <lqez> sample is here : http://runnable.com/U1_O0Lim2HpDJ9XV/using-summernoteinplacewidget-with-bootstrap3-for-python-and-django
[07:55:43] <lqez> Faisal_: it was caused by https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/serializers.py#L524-543 but it's very complicated mixes = django + django-restframework + django-mongodb-engine
[07:55:50] <lqez> so it's very hard to reproduce same error
[07:57:46] <lqez> Additionally, the problem was not up to django-mongodb-engine, just related with django-restframework while serializing.
[08:50:26] <backSlasher> Anyone has any experience with database defragmentation using `compact`?
[08:56:07] <rspijker> backSlasher: just ask your question :)
[08:57:16] <backSlasher> rspijker, How can I tell if my DB needs compacting without baselining? I'm looking for an actual indicator of "whitespaces in your file"
[08:58:28] <kali> backSlasher: look at db.collection.stats()
[08:58:57] <backSlasher> kali, I know about the difference between the data size and file size, but that could be whitespaces at the end of the file , no?
[09:01:57] <kali> with 2.6 and the default allocator being powerOf2 anyway, i'm not sure defragmenting is still that relevant
[09:02:31] <rspijker> there is no realistic way of checking *actual* fragmentation that I know of
[09:02:50] <rspijker> that is, checking an extent and determining the degree to which it is fragmented
[09:07:43] <backSlasher> I figured as much, but wanted to check anyway
[09:09:25] <rspijker> anyway, kali is fairly correct. With the powersOf2 especially, the need for defragmentation will be very minimal
[09:13:01] <Faisal_> @lquez_ I could see support for buld update here - http://www.django-rest-framework.org/api-guide/serializers#dealing-with-multiple-objects
[09:14:58] <backSlasher> so I'm not so sure anymore
[09:17:50] <newbsduser> hello, i have a database named: HTTP. example data: http://pastebin.com/ykkV52qS ... how can i query group by count of HttpHost field..?
[09:17:59] <newbsduser> iam trying to do it on mongo shell
[09:18:40] <newbsduser> i want to see a list like: domainname.com-10, domainname2.com-9...
[09:30:14] <Gargoyle> Anyone use instance storage (not ebs) for mongo servers on AWS ?
[09:36:54] <rspijker> would sort descending on viewsHttphost
[09:42:35] <mrfraggs> hoi, quick question: so im building a setup using mongo db and was wondering if it acceptable to use a replica set cluster type setup and failover to the "new" primary if the old one dies or would this undermine some ideas of mongodb ?
[09:46:46] <rspijker> mrfraggs: that sounds like exactly the point of replica sets...
[09:55:03] <lqez> Faisal_: my ID is lqez, not lquez_ :)
[11:30:13] <gameboy__> in documentation in Text Search Languages there is't polish and i cant find information when or if the polish language will be supported by mongo
[11:30:47] <gameboy__> mayby you know some way how to add another languages ?
[11:34:24] <cheeser> there's no open jira for it. you might consider filing one.
[12:25:22] <Gargoyle> rspijker: You could pick a shard key which is date based, but that will result in a lot of block shuffling by the sharding process.
[12:27:30] <Gargoyle> talbott: You could probably do something in the background using the oplog
[12:28:21] <Gargoyle> talbott: SSD = Capped collection or TTL. Then have a process which reads the oplog and writes to a normal collection on the archive server.
[12:30:11] <rspijker> Gargoyle: you can do pre-splitting/distribution
[12:30:36] <rspijker> as well as tagging to ensure that latest chunks go to one host and others to another host
[12:30:43] <Gargoyle> rspijker: Yes, but as time ticks by, blocks will have to be moved from one shard to the other.
[12:31:19] <rspijker> I’m not saying it’s maintenance free, but you can have the mongo do all of the work
[12:31:30] <rspijker> just update tagging boundaries once a month or so
[12:42:28] <Gargoyle> Are drivers backwards compatible? Eg, Is it best to update the language driver first, and then update the DB (2.4 to 2.6), or do the DB first and then update the driver?
[12:44:40] <rspijker> don’t think that’s something we can say in general. Should be clear from release notes most of the time
[12:48:54] <cheeser> the drivers tend to be fairly backward compatible. the java driver gets tested back to 2.2 and only dropped testing against 2.0 when 2.6 shipped.
[12:50:13] <Gargoyle> Thanks guys. Derick: Anything specific about the PHP driver that might be an issue you can think of off the top of your head?
[13:25:16] <mrfraggs> rspijker: cool, and the documentation mostly talks about 3 nodes with 1 arbiter but a 2 node setup would work perfectly fine as well from what i see and have tested. or is it a recommended "need" to use 3 ?
[13:26:44] <FurqanZafarIQ> is it safe to terminate a nodejs app that inserts records to a mongodb? will all the records be flushed from memory to disk?
[13:28:06] <mrfraggs> ok so in a construct of having 2 boxes and from the understanding i have the arbiter is not a "full" node it would make sense to run 4 nodes? 1 primary & 1 arbiter on one box and 1 secondary & 1 arbiter on one box?
[13:30:22] <mrfraggs> ok just reading up on the doc ... the doc kinda killed all my assumptions *OH NOES*
[13:31:02] <Derick> so two data nodes, and one arbiter
[13:31:22] <Derick> you can't really say "a primary" or "a secondary", as they might switch roles at any point
[13:31:37] <rocahenry> I want to export individual pictures from mongodb(bson)
[13:32:09] <mrfraggs> correct - ill need to read into it more ;)
[13:35:16] <og01> hi, when i use a keyFile as described here: http://docs.mongodb.org/manual/tutorial/generate-key-file/ my mongod process does not start and exits with 1, no other output and no logs
[13:36:29] <og01> everything works fine if i dont specify a keyFile
[14:25:57] <rspijker> didn’t really do very much :)
[14:26:02] <rspijker> glad to see it’s working now
[14:45:56] <tadasZ> hi everyone, guys, i'm little confused, all articles i read i see schemas like { params: [{ name: "Brand", value: "Brandisimo" }, {name: "Height", value:"10 meters"}] }, does that mean that for example in brands collection _id of document is like "Brandisimo" or for heights _id:"10 meters" ?
[14:49:58] <ckozak> I'm having a spot of trouble with mongodb in java. Is there anything like BSON.addDecodingHook for keys? I'm trying to store some json data, unfortunately much of it contains periods in keys.
[15:21:07] <rspijker> tadasZ: no. The _id is generated by mongo if it’s not specified explicitly
[15:23:32] <tadasZ> rspijker: i know that, but i mean imagine i have 3 collections - brands, heights and products, and products has to have dynamic params like in example, but in all artiles i see people embeding like {"name": "Brand", value:"Brand name"} shouldn't it be {"name": "Brand", value:ObjectId(...) } ?
[15:24:38] <rspijker> no… mongo is not sql… It’s, by nature, not relational
[15:26:53] <rspijker> you should keep that in mind already when you are defining your schemas
[15:30:36] <FurqanZafarIQ> is it safe to terminate a nodejs app that inserts records to a mongodb? will all the records be flushed from memory to disk?
[15:53:18] <tadasZ> rspijker: i understand that, but do you say that everytime i want to set parameters to product i need to enter brand name by hand ?
[15:54:21] <rspijker> tadasZ: as opposed to…. entering the ObjectId by hand?
[15:54:28] <rspijker> maybe I’m not understanding your usecase here
[15:55:48] <tadasZ> sec i'll try to describe a usecase in more detail
[15:59:30] <Nodex> tadasZ : the general rule of thumb is the path of least resistance should win, providing of course that's good for your app as an entirity
[16:19:31] <uehtesham90> im export my mongodb collections to a csv file....is there a way i can rename the fields into a more readable format like username instead of _id.username
[17:17:18] <og01> how can i get secondaries to accept read requests?
[17:54:54] <uf6667> anybody here who can help me with aggregation please?
[18:30:40] <revoohc> in MongoDB 2.2, is there anyway to find out where a specific long running connection is coming from? I.e in my log i have conn1234, I want to find out where the client is.
[19:05:03] <Chaos_zero> trying to save some bandwidth, suppose I make a query for a document which contains, among other fields, one rather large array. Can my projection start to only return the length of the array but not its contents?
[19:42:38] <jonyfive> on this page, https://www.mongodb.com/products/training/certification ...under "Resources" it says "Free online courses from MongoDB University"
[19:43:00] <jonyfive> but i've signed up for an account there and it seems i only see options to pay for an exam
[19:43:48] <jonyfive> sorry i see now, only some courses are free
[19:44:24] <jonyfive> guess i just needed to talk that one out ;)
[20:00:32] <huleo> I'm wondering if I'm trying to do something impossible. Array of objects inside document, "places" let's call them, each object in this array containing user id (which user) and number of visits.
[20:01:00] <huleo> now, just to add new user to this array with "1" as number of visits - easy
[20:01:24] <huleo> and to get visits to increase by 1 - easy as well
[20:02:03] <huleo> but is this behavior possible: create new doc in this array /if/ one with specified "user_id" does not exist...and if it exists, just increase number of visits by one
[20:02:10] <huleo> of course dreaming of one-query solution
[20:40:47] <huleo> updating it nicely, so in "visitors" array we always have only one doc with specific user_id, and noOfVisits increases by 1 with each update
[20:41:08] <huleo> basically, if it exists: create, if it does not: just increase one field by 1
[21:34:30] <s2013> can someone guide me to importing db into mongo? im new to mongo
[21:35:01] <s2013> we exported a db from parse.com its a 1.3gig db with bunch of json files (each tables). i installed mongodb do i use mongoimport?
[23:45:17] <s2013> exception:JSONArray file too large .. i used mongoimport -d db -c collection file.json --jsonArray
[23:45:54] <s2013> how do i import a large db into mongo? it has about ad ozen collections/tables