PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 16th of December, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:21] <delinquentme> zamnuts, I could give you an example json file ?
[00:01:37] <zamnuts> sure
[00:01:59] <delinquentme> on pulling this information in ... each of the top level items should be getting an _id right?
[00:02:19] <delinquentme> so a query like : db.keywords.find( { _id: 1 } ) ... should cough back something
[00:04:15] <zamnuts> _id will be created automatically
[00:04:32] <zamnuts> and _id is not autoincrement like sql
[00:08:17] <delinquentme> zamnuts, I'd say I don't follow ... but actually I dont understand how, say in this case, you could have 4 top level items all w the same ID ?
[00:10:11] <joannac> delinquentme: it is not possible to have more than one document with the same _id
[00:11:31] <delinquentme> ok so that makes sense . but whats this thing about non-incrementing ?
[00:12:11] <Boomtime> the default _id is not an auto-incrementing number, it is generated from several local sources
[00:12:37] <Boomtime> it is merely unique, it also tends to increase monotonically due to the embeddee3d timestamp
[00:19:41] <delinquentme> zamnuts, 2014-12-15T15:52:59.788-0800 imported 1 objects
[00:19:44] <delinquentme> there we go !
[00:29:24] <Boomtime> delinquentme: it sounds like your json file contains a single object, can you paste the first few lines into pastebin/gist?
[00:30:48] <MacWinner> so I get into the occasional discussion here in SF about mongo. There seem to be a lot of haters here. I've been using mongo and it's been working beautifully. My assumption is most of these people are just talking heads that either have dated information or are regurgitating something they saw on hackernews. Objectively, are there specific use cases where Mongo is fatally flawed, or will actually not write data.. I'm trying to sort out the FUD.
[00:31:43] <MacWinner> the 2 most common complaints are that mongo silenty drops data.. or mongo's cluster election algorithm is flawed..
[00:32:33] <Boomtime> the "silently drops data" is a reference to a situation that existed many years ago, in that drivers defaulted to a write-mode referred to as "unackowledged"
[00:33:15] <Boomtime> note that mongodb itself never ever dropped data silently, but it was the case that a poorly configured app could fail to contact mongodb and remain unaware
[00:37:24] <MacWinner> Boomtime, got it. so more recent versions of drivers use a different write-mode/
[00:37:25] <MacWinner> ?
[00:38:40] <Boomtime> all drivers now default to an acknowledged write-concern
[00:38:59] <Boomtime> this means the data is durable to a single database host
[00:39:00] <cheeser> since 2.4
[01:01:14] <zamnuts> Boomtime, acknowledged write-concern? as in 1 or 'majority' ?
[01:16:32] <Boomtime> zamnuts: unfortunately, neither.. acknowledged is in-memory only, not necessarily journaled
[01:22:52] <zamnuts> Boomtime, journaled acknowledgment would be in the form of j:true, and in-memory only - in the driver only? so rather than firing and forgetting, it gets a "ACK" from mongodb, how is this different than w:1 ?
[01:23:18] <zamnuts> lawl... i'm full of questions!
[01:24:05] <Boomtime> sorry, my statement was wrong, acknowledged is w:1, which is in-memory only
[01:24:15] <Boomtime> add j:1 for journaled
[01:25:19] <Boomtime> you don't really have durability until w:majority though so may as well just do that if you want to be assured
[02:30:59] <ggoodman> Can anyone think of a way to query for documents that have an ObjectId as _id?
[02:31:42] <ggoodman> oh, $type
[03:34:22] <JakeTheAfroPedob> hi there anyone around?
[03:37:47] <joannac> JakeTheAfroPedob: just ask your question
[03:39:30] <JakeTheAfroPedob> is there anyone here familiar with text processing? am trying to do something with tf-idf
[03:39:44] <JakeTheAfroPedob> not really anything regarding mongodb
[03:41:09] <JakeTheAfroPedob> from the examples that i see regarding tf-idf calculations using the sklearn package most of them only stores strings of texts. What i want to do with it will be storing documents/.txt files in it then only run the process
[04:45:59] <Guest____> hi all. I'm installing mongodb on ubuntu 12.04 with apt-get, and I'm running into problems that I think can be solved by adjusting the ulimit on my machine
[04:46:08] <Guest____> but I'm not sure how to set the ulimit permanently for mongodb
[04:53:28] <joannac> Guest____: edit /etc/security/limits.conf ?
[04:53:48] <Guest____> @joannac do I then have to reboot my machine? Or can I just `sudo service mongod restart`
[04:54:19] <joannac> you just need to restart the service
[04:54:35] <Guest____> ahh sweet
[04:55:45] <Guest____> i'll try that, thanks
[05:36:13] <Guest____> hi all. I'm trying to restore a db snapshot into mongo, but it keeps failing because I've consumed too much disk space (i'm running on a vm with 40gb of space)
[05:36:42] <joannac> Guest____: okay... so allocate more disk space to this VM?
[05:38:01] <Guest____> @joannac /var/lib/mongodb consumes 24GB on disk. Is that normal? Is my problem really just that I should allocate more disk space? The dump files that I'm restoring from take about 9.4GB on disk
[05:38:08] <Guest____> I guess I just wouldn't expect almost 3x inflation
[05:38:37] <JakeTheAfroPedob> your cache or soemthing is taking up a lot of your space i dont think mongodb is that big
[05:40:09] <Guest____> JakeTheAfroPedob `sudo du -x -d1 -h -a /var/lib/mongodb/` yields an entry `24G /var/lib/mongodb`
[05:42:54] <JakeTheAfroPedob> not sure about it sorry
[05:44:15] <JakeTheAfroPedob> for me its less than 5Gb in total
[05:44:26] <JakeTheAfroPedob> maybe about 7gb
[05:44:42] <JakeTheAfroPedob> the biggest two are
[05:44:42] <JakeTheAfroPedob> sudo du -x -d1 -h -a /var/lib/mongodb/
[05:44:49] <JakeTheAfroPedob> 3.1G /var/lib/mongodb/journal
[05:45:01] <JakeTheAfroPedob> 3.7G /var/lib/mongodb/
[05:45:08] <joannac> Guest____: I'm not sure I understand. You have an empty mongod instance, and after restoring dumps of 9gb, the db files take up 24gb?
[05:45:16] <JakeTheAfroPedob> the rest are nowehere close to a 250mb
[05:45:27] <joannac> Guest____: do your dumps by chance span many different databases?
[05:47:16] <Guest____> @joannac the restore doesn't even finish, it runs out of space and fails
[05:47:37] <Guest____> The dumps do span multiple dbs, but I'm only restoring one of them
[05:48:31] <arussel> I have to have a field with 5 char, unique withing the collection, what is the best way to do it ?
[05:49:22] <joannac> Guest____: okay, how much free space is there? And how large is the database you're restoring?
[05:49:26] <joannac> arussel: do it app-side
[05:49:49] <joannac> arussel: well, do the "5 char" part app-side, and create a unique index on it in the database
[05:50:54] <Guest____> @joannac before the dump there's almost exactly 25G avaible, then during the dump, it runs out of space at a hard cap of 40
[05:51:28] <joannac> Guest____: I thought you were restoring
[05:51:37] <Guest____> sorry, yea, during the restore
[05:52:25] <arussel> joannac: so create a unique index, try to insert it and if get an error try with another ?
[05:52:50] <joannac> arussel: yeah, if that makes sense with your app
[05:53:00] <arussel> joannac: it does
[05:53:04] <arussel> joannac: thanks
[05:53:35] <joannac> Guest____: I call shenanigans.
[05:54:06] <joannac> especially since you mentioned before it takes up 25GB on disk
[05:55:24] <joannac> pastebin a df (showing free space), and a `ls -laR` of the dump you're trying to restore from
[05:55:25] <Guest____> I mean I guesstimated the available space before the restore (I hit this error in the middle of provisioning a vagrant box)
[07:05:58] <Guest44126> hi, how to fix this problem: http://pastie.org/9781623 ?
[07:08:04] <Boomtime> interesting.. you can try flushRouterConfig on the mongos that is printing that
[07:08:34] <Boomtime> connect to the mongos in mongo shell then: db.adminCommand({flushRouterConfig:1})
[07:32:24] <Guest44126> Boomtime, i do and still is the same problem
[07:35:44] <Guest44126> Boomtime, I want to remove one shard but i cant because I have chunks on this shard http://pastie.org/9781758
[09:20:59] <fatih> Hi Everyone
[09:21:16] <fatih> Here is a question about querying non empty and existing fields: http://stackoverflow.com/questions/9694223/test-empty-string-in-mongodb-and-pymongo
[09:21:28] <fatih> the query is basically: db.collection.find({"lastname" : {"$exists" : true, "$ne" : ""}})
[09:21:40] <fatih> how can I achieve the opposite ?
[09:22:11] <fatih> So in that example I want to fetch empty fields or documents whose doesn't have that field
[10:43:41] <Naeblis> How can I populate nested documents in Mongoose? A -> B -> C, and I want to do something like: A.find(...).populate('b.c')
[10:53:08] <haakonn> hello, i have a simple replicaset with mongodb 2.6.5. looking to upgrade to 2.6.6. is this safe to do node-by-node without any particular precautions? thinking of doing the secondaries first, then the master
[10:53:47] <leenug> Hi All, is anyone able to point me in the right direction with converting a very simple SQL query to mongo: http://laravel.io/bin/qQLJR
[10:56:14] <kali> leenug: aggregation framework
[10:57:48] <leenug> kali: ok, thanks im taking a look
[11:43:08] <josias> is here someone knowing the mongodb-async-driver? is there a Problem with aggregating on empty fields?
[11:58:27] <arussel> http://docs.mongodb.org/manual/tutorial/create-an-index/ doesn't mention an index type, but reactive mongo expect a type for each index (Ascending, Descending, Geo, hashed or Text).
[11:58:41] <arussel> what type should I use for a default index ?
[11:59:09] <arussel> it is a very small fied so don't need to be hashed and I'm not querying < or > on it.
[11:59:18] <arussel> I just need it for the uniqueness
[12:09:52] <kali> arussel: hashed index is only relevant for sharding keys. stick with the default (btree)
[12:14:40] <arussel> kali: reactive mongo forces me to use a type, what is the default ?
[12:15:16] <arussel> https://github.com/ReactiveMongo/ReactiveMongo/blob/master/driver/src/main/scala/api/indexes.scala
[12:15:31] <arussel> should I use Ascending or Descending ?
[12:15:40] <arussel> (which one really doesn't matter)
[12:16:39] <kali> ascending
[12:18:30] <arussel> kali: thanks
[12:28:10] <Guest44126> how to fix this problem: http://pastie.org/9781623 ?
[13:49:39] <salty-horse> is there a way to ask mongodb just for the length of an array, instead of it returning all the elements?
[13:52:44] <salty-horse> (This SO page doesn't give a satisfying answer. Perhaps there isn't one: http://stackoverflow.com/questions/6722850/querying-internal-array-size-in-mongodb )
[13:56:25] <winem_> salty-horse this is a job for the aggregation framework
[13:57:22] <salty-horse> winem_, is it a valid usecase for the aggregation framework to query just one document?
[13:57:33] <winem_> let me search for the official doc
[13:57:57] <salty-horse> winem_, also, the SO page describes $size as a 2.6 feature. I'm on 2.4
[13:58:20] <winem_> http://docs.mongodb.org/master/reference/operator/aggregation/size/#exp._S_size
[13:58:41] <winem_> oh ok, I think it's not available in 2.4... will check this
[13:58:53] <winem_> just read this chapter in the book a few days ago...
[13:58:56] <salty-horse> winem_, the page you linked doesn't have $size in 2.4
[13:59:54] <salty-horse> winem_, can you at least answer my question about expected use of the aggregation framework? If I use it just to fetch array lengths in single documents, it's not too awful?
[14:01:29] <winem_> at least not accordingly to the official german mongodb book. they recommend this way to query the length of an array
[14:02:07] <winem_> unfortunately, I don't have it here right now but I guess it also says you have to write your own function to query the array length in older versions
[14:09:50] <salty-horse> winem_, thanks. I think I'll maintain a counter. problem is, I'll have to know whenever I push/pop successfully to the array
[14:10:27] <winem_> so you'd like to get the length of an array after every operation on it?
[14:11:33] <salty-horse> winem_, I guess I'll do that, yes. (just to save it in a separate field, to ease future queries)
[14:11:49] <winem_> what about getLastError?
[14:12:34] <winem_> I think this should also work. depends a bit on your setup (sharded, replicasets, etc.)
[15:39:33] <iejfiew> Anyone else seen this:
[15:39:36] <iejfiew> A serialization options attribute of type BsonRepresentationAttribute cannot be used when the serializer is of type BsonClassMapSerializer.
[15:39:56] <iejfiew> C# driver
[16:25:19] <Naeblis> Can anyone help me out with Mongoose?
[16:25:56] <Naeblis> I'm trying to modify a property of a Query result to manually embed some nested documents in it before sending out a JSON response.
[16:26:27] <Naeblis> only, it seems like the result is immutable. lean() isn't helping.
[16:26:31] <Naeblis> :/
[16:49:57] <krion> hello
[16:50:11] <krion> i'm wonderin why authentification is disabled by default
[17:18:18] <adrian_lc> hi, does anyone know of an easy way to reuse a custom JSONEncoder with pymongo as a SONManipulator?
[18:01:58] <jsonperl> Is there an easy way to see what exactly is creating a write lock at any given time?
[18:16:58] <krisfremen> hi there, trying to install mongodb on debian from the mongo repos, and I'm getting apt-get errors
[18:17:09] <krisfremen> invoke-rc.d: initscript mongodb, action "start" failed.
[18:46:53] <regreddit> krisfremen, what is the output of: sudo invoke-rc.d mongodb start ?
[19:45:31] <vacho> guys.. would love someones input on following question.. If I want relational data in Mongo..do I nest it?? e.g. I have TV Titles and Actors.... how would I relate these 2 sets?
[19:46:23] <cheeser> i'd use references
[19:46:49] <cheeser> Actors are going to be in a lot of TV titles, potentially
[19:49:44] <vacho> cheeser: can u link me where I can learn more about this?
[19:52:44] <cheeser> http://docs.mongodb.org/manual/data-modeling/
[19:52:48] <cheeser> http://docs.mongodb.org/manual/core/data-model-design/
[19:56:00] <vacho> cheeser: thanks!
[19:56:16] <cheeser> np
[20:33:43] <wayne> why would i want a negative index?
[20:33:48] <wayne> i.e. descending
[20:34:06] <wayne> e.g. does it have any benefit in terms of runtime vs. a positive one?
[20:34:08] <brianseeders> most recent timestamp first
[20:34:29] <wayne> brianseeders: couldn't i just reverse sort quicky with a positive index?
[20:36:23] <brianseeders> I believe it matters more for compound indexes
[20:36:40] <brianseeders> (indexes with more than one field)
[20:39:14] <brianseeders> yes, it appears that with a compound index you cannot invert only one of the orders in a query
[20:39:33] <brianseeders> e.g. with A:1,B:-1, you can't do a query with A:1,B:1
[20:39:40] <brianseeders> but you could do A:-1,B:1
[20:54:03] <whataba> hi folks, i'm running a server (debian) with upstart installed... to get mongodb installed should the ubuntu install .deb (upstart-compatible) work fine? or should i stick with the debian (sysvinit)? thanks
[21:16:59] <boxxa> Can someone help me out with an export to CSV? I have a collection that has fields and then two fields that contain sub documents. I tried using RazorSQL but that exports a CSV line with field,field,{sub1,sub2,sub3,sub4},field,field etc
[21:17:31] <cheeser> mongoexport will do that.
[21:18:07] <boxxa> how will it classify the subdocuments
[21:18:15] <jabclab> hey all, just wondering if mongod log file size will have any impact on performance?
[21:18:15] <cheeser> dunno
[21:19:52] <luca3m> hi, I'm implementing a parser for mongodb protocol, I'm noticing that many driver use de QUERY command instead of INSERT or UPDATE defined in the wire protocol. Why? Are the latter being deprecated?
[21:20:31] <cheeser> the write commands should be preferred
[21:21:56] <luca3m> do you mean INSERT and UPDATE commands on the protocol specification? or Insert inside a QUERY code, using $cmd as collection?
[21:22:23] <cheeser> the former
[21:24:17] <luca3m> ok thanks
[21:26:32] <luca3m> probably because they use write concerns, so they should need anyway another QUERY request with getLastError
[21:26:33] <MacWinner> anyone here using Tokumx in production without issue at a scale of maybe 100k documents per day or more?
[21:26:46] <MacWinner> just stumbled upon it, and it seems like black magic
[21:28:38] <cheeser> seems pretty low
[22:22:29] <diamonds> what's the purpose of these TWO startup files in ubuntu? http://hastebin.com/ecegofajek.sh
[22:28:28] <ehershey> is one old?
[22:28:30] <ehershey> where'd you get them?
[22:29:06] <diamonds> ehershey, idk
[22:29:21] <diamonds> ehershey, I probably had mongo on this box long ago then uninstalled, maybe reinstalled
[22:29:24] <diamonds> I mean I didn't place them there
[22:37:03] <diamonds> so these files are redundant?
[22:55:56] <ehershey> yeah
[22:56:04] <ehershey> one is probably from a really old version
[23:01:36] <diamonds> ok so I just uninstalled mongodb & deleted all the configs
[23:01:44] <diamonds> so I'll see what comes when I reinstall
[23:02:01] <ehershey> cool
[23:54:32] <seiyria> ok so how do people debug "Incorrect arguments"
[23:54:43] <seiyria> my logs are flooded with this error and I have no idea where it's coming from and it's driving me insane.
[23:56:30] <Boomtime> first up, can you provide an example of the message you are seeing?
[23:56:55] <Boomtime> if you really want to debug it alone, then you can increase the loglevel to try to cause more information tro be printed: http://docs.mongodb.org/manual/reference/parameters/#param.logLevel
[23:57:22] <Boomtime> try setting loglevel 1 first, if that doesn't give you enough context, try 2...
[23:57:46] <Boomtime> increasing loglevel causes your logs to grow much more quickly, be prepared to return loglevel to zero as soon as you can
[23:58:46] <seiyria> Boomtime, http://puu.sh/dxHDW/bb3f31050e.png
[23:58:50] <seiyria> it points to nothing in my code :(
[23:59:27] <Boomtime> ok, so that is an application problem - you need to add your own logging