PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 19th of March, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:07:08] <MLM> What is a good web interface to browse a local MongoDB database?
[00:07:16] <MLM> None of these really jump out at me: http://docs.mongodb.org/ecosystem/tools/administration-interfaces/
[00:22:10] <acidjazz> > db.customer.update( {"_id": "54efa10e86c28789098b4567"}, { $set {"customer.name": "Demo Customer"}});
[00:22:25] <acidjazz> how is this a syntax error.. whats the easiest way to just change a field value??
[00:22:59] <joannac> acidjazz: what's the document look like?
[00:23:14] <joannac> acidjazz: wait, you're missing a colon
[00:23:20] <joannac> $set : {...}
[00:23:24] <joannac> the colon after $set
[00:25:26] <acidjazz> joannac: thanks
[00:25:27] <acidjazz> got it
[00:25:32] <acidjazz> i guess $set is the way then eh
[00:45:31] <MLM> To follow-up on my question about a good web interface to browse a local MongoDB database. I downloaded MongoVUE: http://www.mongovue.com/ - which seems like it will work well
[00:48:27] <MLM> (note: not actually a web interface)
[00:56:50] <kakashiAL> hey guys, does the method isModified() from mongoose, check the database?
[00:59:13] <MLM> For reference: http://mongoosejs.com/docs/api.html#document_Document-isModified (not answer)
[01:01:06] <kakashiAL> MLM: I know that site, but it doesnt answer my question
[01:01:15] <kakashiAL> it only say what it returns and what it needs
[01:01:20] <MLM> "(not answer)"
[01:01:41] <kakashiAL> so why the link, if it is not an anwer?
[01:03:15] <MLM> It could help others get acquainted more quickly with the method you have a question about
[01:24:22] <shlant> can anyone explain why -d isn't working for mongorestore? mongorestore --file /tmp/mongodumps/tv -d db_name
[01:24:43] <shlant> I just end up with a 'local' db
[01:25:23] <joannac> what's the db_name ?
[01:25:32] <joannac> what's inside that folder?
[01:25:39] <shlant> .json and .bson
[01:26:17] <joannac> ...and the answer to my first question?
[01:26:36] <shlant> joannac: the db_name is a placeholder for the db name I am actually using
[01:26:38] <shlant> could be anything
[01:26:46] <shlant> -d blah
[01:26:58] <shlant> it does not already exist
[01:26:58] <joannac> what version?
[01:27:10] <shlant> v2.6.8
[01:27:46] <joannac> $ mongorestore --file
[01:27:47] <joannac> Error parsing command line: unknown option file
[01:28:51] <shlant> joannac: ah. I was looking at the wrong version docs ;)
[01:29:56] <kakashiAL> does the method isModified() from mongoose, check the database?
[01:31:50] <joannac> shlant: okay, so without the --file bit
[01:32:18] <shlant> same thing
[01:32:18] <joannac> mongorestore /tmp/mongodumps/tv -d foobar
[01:32:26] <shlant> mongorestore -d db_name /tmp/mongodumps/tv
[01:32:28] <joannac> what output do you get? pastebin/gist please
[01:32:30] <shlant> oh
[01:33:04] <shlant> "The final argument of the mongorestore command is a directory path"
[01:33:06] <shlant> huh?
[01:33:25] <shlant> the example has the path like I did
[01:33:29] <shlant> mongorestore -d db_name /tmp/mongodumps/tv
[01:33:36] <joannac> what's inside /tmp/mongodumps/tv?
[01:33:47] <shlant> .json and .bson...
[01:33:55] <joannac> ls -la and pastebin
[01:34:27] <shlant> https://gist.github.com/a10008b11ddea787c024
[01:34:36] <joannac> also, pastebin the output of your mongorestore line
[01:35:41] <joannac> pastebin/gist/whatever
[01:39:34] <joannac> ...
[01:40:04] <cheeser> another satisfied customer.
[01:41:38] <GothAlice> Some days, I all the things.
[01:46:16] <kakashiAL> any mongooose user here?
[01:48:52] <luaboy> what is the use of this code ? db = motor.MotorClient().stocks
[01:52:26] <joannac> luaboy: erm, I don't know? What's a MotorClient?
[01:54:50] <kakashiAL> there is a method in mongoose called isModified(), it returns true or false and you can pass a key of your model as an argument for that function, but what I dont understand is does it queries the database to check if the value changed or not?
[01:55:53] <luaboy> joannac:it is mongodb driver ito python
[01:55:59] <luaboy> to
[01:57:54] <joannac> luaboy: do you maybe mean MongoClient
[01:59:12] <joannac> also, what's the variable "motor"?
[01:59:54] <luaboy> joannac is mongodb driver to python
[02:00:04] <luaboy> joannac/:motor is mongodb driver to python
[02:00:10] <luaboy> sorry
[02:00:49] <joannac> luaboy: aha. okay, then I have no idea
[02:01:07] <joannac> I don't keep track of third-party drivers
[02:08:43] <joannac> luaboy: based on what i know of the python driver, it creates a connection to the mongod running at 127.0.0.1:27017, and then sets the "active database" (for lack of a better word) to "stocks"
[02:13:00] <luaboy> joannac:if my mongod is not working at the default port ,how is that?
[02:20:25] <Hoyt> Hi, what's the common solution for this? http://stackoverflow.com/questions/29135598
[02:20:40] <Hoyt> Put them in the same collection?
[02:32:46] <joannac> luaboy: erm, check if the mongod process is running?
[02:33:10] <joannac> hmsimha: yes, put them in the same collection
[02:33:47] <hmsimha> joannac: looks like you meant to refer to Hoyt
[02:46:37] <joannac> hmsimha: you're right, my apologies :(
[03:35:13] <shlant> anyone doing mongorestor  with docker? I'm hitting an error and don't know what to do. Not even sure if this is the best way to do it: https://gist.github.com/MrMMorris/ac74af2188483c69eb41
[03:35:20] <shlant> "9001 socket exception"
[04:00:27] <joannac> shlant: is the mongod process still up at that point?
[04:00:57] <shlant> joannac: I actually JUST got it working
[04:01:06] <shlant> the memory limit I put on the container was too small
[04:01:09] <shlant> :p
[06:47:30] <anuvrat> ts field in oplog is not indexed ... how do I find newer operations?
[06:49:11] <joannac> for what purpose? curiousity?
[06:53:47] <joannac> I don't think you can avoid a collscan
[06:56:38] <anuvrat> joannac: need to sync the docs with elasticsearch
[07:02:22] <anuvrat> joannac: there?
[07:05:34] <joannac> anuvrat: yes, I'm here. I suspect there's probably already something that'll do that for you
[07:06:12] <anuvrat> joannac: I am aware of the mongodb-river
[07:06:24] <anuvrat> mongodb-river plugin
[07:07:13] <anuvrat> however there is a limitation in there
[07:07:29] <anuvrat> joannac: I'm trying to write something of my own ...
[07:16:48] <anuvrat> how do I resume after my tailable connection breaks?
[07:17:30] <KekSi> can anyone explain to me what that red paragraph up there means: http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/ ?
[07:18:08] <KekSi> the way i see it either *all* parts of the cluster use localhost or *none* do
[07:19:38] <KekSi> all my parts do but when i try to add the first shard from a query router (running on the same machine as the shard which should eventually become a replicaset) it connects to the shard
[07:20:12] <KekSi> but shows "couldn't connect to new shard socked exception [CONNECT_ERROR] for ...
[07:37:01] <KekSi> in other words: where do i bind_ip when i'm running all my cluster parts in docker containers? :S
[08:43:10] <markand> hey
[08:43:27] <markand> what library does mongodb use for the shell prompt in Windows?
[08:59:44] <robopuff> Hey, can you guys help me with this http://stackoverflow.com/questions/28740593/mongodb-conditional-aggregate
[10:00:25] <robopuff> Is it possible to use $ projection within aggregation framework (especially with $project)?
[10:05:16] <hmsimha> robopuff: $project *is* an aggregation pipeline operator (http://docs.mongodb.org/manual/reference/operator/aggregation/project/) Not sure if that's what you were asking
[10:07:27] <robopuff> hmsimha: I need to get a specific array element to create a proper calculation ($project: { $add: [ ... ] }), and i thought that I could use $(projection) (http://docs.mongodb.org/v2.6/reference/operator/projection/positional/)
[10:09:49] <hmsimha> I see. I think you can do that
[10:10:41] <hmsimha> I think you would put it in $match though
[10:12:01] <robopuff> I need to sort through it as well
[10:12:16] <hmsimha> is this in regards to the so question robopuff?
[10:12:48] <robopuff> yup
[10:15:26] <hmsimha> robopuff: I think you'll find here that the biggest problem (as is often the case) is how you've structured your data. That being said, it may be possible to do what you're trying to do
[10:19:10] <robopuff> hmsimha: http://ctrlv.it//id/376/2793825352 this is how document looks like
[10:19:57] <robopuff> I need to calculate price based on calendar entry and if not exist (calendar entry or pricing in it) then add basic price
[10:22:19] <robopuff> Or maybe there is a better way to store that kind of data - at this point there is no problem with redefining this
[10:22:53] <hmsimha> robopuff: are you only intending to match one of the objects in the calendar array?
[10:24:26] <robopuff> hmsimha: all that match dates specified by user, so if user chose a 2015-01-18 to 2015-01-22 I have to calc all entries between those dates
[10:25:16] <hmsimha> Hmm, why don't you stick the find before the projection then?
[10:25:40] <robopuff> What do you mean?
[10:27:21] <hmsimha> if you need to find and project, you can do db.collection.find(... <something with the <array>.$ operator>).project(...)
[10:28:04] <hmsimha> Oh, I'm sorry, I've been using mongoose and it occurs to me this might be a mongoose feature
[10:29:08] <hmsimha> never mind, of course this is part of mongodb also
[10:29:55] <robopuff> Hmmm, mongo tells me that after db.collection.find(...).project() is not a function :(
[10:30:19] <hmsimha> but it's my bad. db.collection.find(...).aggregate(...)
[10:33:45] <robopuff> .aggregate is not a function (from mongodb console client)
[10:34:42] <robopuff> But as I said, maybe there is a problem with document structure, but since I'm a complete novice in mongo it's hard for me to find it
[10:35:54] <hmsimha> it's ok. I am also. My first thought would be to take an approach where each of the objects you're putting in the calendar array into their own collection, with each having a reference to the _id from the relevant document in the calendars collection
[10:36:32] <hmsimha> I also believe there are issues with indexing things in mongoDB arrays, so this makes it easier to index these
[10:36:42] <hmsimha> I'm not exactly sure what you're data refers to, so I may be wrong
[10:40:59] <robopuff> hmsimha: It's gonna be hard to split into different documents since I've got to find every entry that status: 1 and between dates provided form user there are no calendar entries with status: false
[10:42:47] <robopuff> Maybe it's gonna be better if I write additional filters not on database side, so everything will be possible, but then I have to filter it & create a pagination on those results (additional database or different document maybe?)
[10:42:54] <hmsimha> I don't understand that robopuff. You're saying you need to search these by date and status
[10:43:05] <hmsimha> I'm not sure I see the problem there
[10:43:32] <hmsimha> lets say each of those things in the calendar array goes into a callendarobject collection
[10:43:58] <robopuff> Yup, searching through them is not a problem - I've done it already, but as an addition I need to calculate overall price and filter by it
[10:43:58] <hmsimha> except each of those has an additional field. "calendar: ObjectId("5473572cf1a76349020041c6")" (in this case)
[10:45:13] <hmsimha> so you have one document that {"date" : ISODate("2015-01-20T12:41:20.000Z"), "status" : true, calendar: ObjectId("5473572cf1a76349020041c6}
[10:46:01] <hmsimha> and another document might be { "date" : ISODate("2015-01-22T12:41:20.000Z"), "status" : true, calendar: ("5473572cf1a76349020041c6) }
[10:47:47] <hmsimha> then when you're computing all of the price sums for a specific calendar, you just put {$match: {calendar: ObjectId("5473572cf1a76349020041c6), date: {$gt: <something>, $lt: <something>}, status: true} into the aggregation pipeline
[10:52:19] <hmsimha> robopuff: there's probably a way to do it the way you have it. I just don't know it :P Separating this out into two collections seems like an easier way to work with the data in general to me, if you don't have concerns about operations that need to be done atomically
[10:53:33] <robopuff> Ok, thank a lot!
[11:10:24] <pamp> how can I know what storage engine Im using in the shell?
[12:32:40] <luaboy> how do I start mongodb's shell command line ?
[12:32:58] <Derick> type "mongo" on the shell
[12:40:06] <luaboy> how to create database from mongodb's command line ?
[12:40:51] <Derick> luaboy: please follow: http://docs.mongodb.org/manual/tutorial/getting-started/
[12:41:30] <Derick> (from top to bottom)
[12:43:16] <diegows> :)
[12:43:24] <diegows> create doesn't exists in mongo :P
[12:44:26] <luaboy> diegows:yeah!
[12:45:27] <luaboy> is there any hint?
[12:45:56] <NoReflex> hello! where can I find sample configuration files for mongodb with wired tiger? there are some options I'm having difficulties understanding
[12:46:44] <NoReflex> for example: wiredTigerCacheSizeGB from here: http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption--wiredTigerCacheSizeGB
[12:48:29] <Derick> luaboy: hint for what?
[12:49:36] <StephenLynx> you just select the db and it will be crated on the first write if it doesn't exist.
[12:52:05] <cheeser> the only thing you need to explicitly create are capped collections
[12:52:22] <cheeser> even those can be converted from normal collections
[12:52:24] <StephenLynx> same with collections
[13:00:53] <luaboy> Derick:how to create database from command line
[13:01:15] <cheeser> luaboy: 08:49 < StephenLynx> you just select the db and it will be crated on the first write if it doesn't exist.
[13:02:38] <Derick> luaboy: can you please follow the tutorial that I posted a link to - it answers this question, the why, and many more
[13:05:27] <StephenLynx> I don't say it often, but RTFM, luaboy
[15:42:18] <lxsameer> hey guys, what is the biggest file size that GridFS supports ?
[15:45:08] <Derick> lxsameer: theoretically, the available disk space
[15:45:13] <Derick> there is no hardcoded limit
[15:45:32] <lxsameer> Derick: so what is the 16Mb limit ? is it chunk size limit ?
[15:45:37] <Derick> yes
[15:45:43] <Derick> because it's a single document size limit
[15:45:57] <Derick> each chunk is stored in a document
[18:01:53] <girb1> Hi all .. I have a sharded cluster .. if i wont use keyfile for authentication is that ok ?
[18:02:19] <girb1> want to use just "auth = true in config's
[18:02:26] <girb1> please help
[18:04:11] <girb1> is keyFile a required option ?
[18:08:31] <StephenLynx> I did some experiments with authenticated servers these days, I managed to create an user account and use it with auth=true only.
[18:08:41] <StephenLynx> without key servers
[18:08:53] <StephenLynx> so I guess that no, you don't have to have key files.
[18:08:57] <StephenLynx> i GUESS
[18:09:43] <cheeser> there! no more bouncing for a while.
[18:16:12] <cr0wrx> does anyone have any suggestions on why auth is failing for me? I spun up a new replica set, I can auth from any of the nodes within replica set using mongo command line client, but if I go to any other machine, I cannot auth successfully
[18:18:40] <girb1> StephenLynx: did you check with sharded clusters
[18:18:46] <StephenLynx> no.
[18:18:57] <StephenLynx> just a single VM.
[18:19:04] <StephenLynx> thats why I am not giving you any guarantees.
[18:19:39] <girb1> it won't work :(
[18:19:46] <girb1> just checked
[18:46:14] <girb1> is there any way I can use keFile without yaml ?
[18:46:22] <girb1> auth keyFile
[18:52:57] <Boomtime> girb1: command-line
[18:53:21] <girb1> Boomtime: in config ?
[18:53:27] <Boomtime> no, command-line
[18:53:49] <Boomtime> paste here the command-line you use to start mongod
[18:54:28] <girb1> Boomtime: I know to start with command line . thanks
[18:55:14] <Boomtime> add: --keyFile <keyfilename>
[18:55:38] <girb1> ok.. will try out
[19:33:18] <bashusr> what would be the best datastore for 5 star ranking data where I would be needing to aggregate the mean of the rankings per object and display it as an ordered list?
[19:33:44] <bashusr> i'm not sure if i should do that in SQL, mongodb, or any other datastore
[19:44:29] <GothAlice> cheeser: If someone's coding up a bot that's behaving badly, banning it likely threw a large wrench into the mix. (I doubt it would gracefully handle error conditions, like when attempting to re-join. ;)
[19:44:58] <cheeser> it's been bouncing all day so I have little sympathy for the developer. :)
[19:45:30] <GothAlice> Yeah, bouncing once per minute is a tad excessive.
[19:45:45] <GothAlice> (Glad I normally keep join/part/nick commands hidden. ;)
[19:46:22] <cheeser> i op in several channels so I like seeing what's going on.
[19:57:32] <GothAlice> cheeser: *nods* I tell my IRC client to dump all of the metadata chatter into the connection tab instead of littering each channel tab. A little grep goes a long way at that point. ;)
[19:58:26] <cheeser> i closed that tab/window (irssi)
[20:03:36] <bashusr> if someone is coding a bot, they should do it in ##test or something like that so you don't flood a mainstream channel
[20:06:01] <GothAlice> bashusr: For sure.
[20:08:49] <cheeser> i don't think latestbot actually is a bot. i saw her talking with other users earlier.
[20:09:03] <cheeser> yeah. not a bot
[20:09:10] <cheeser> http://irclogger.com/.mongodb/2015-03-19#1426773696
[20:09:27] <GothAlice> Well, technically I'm puppeting a bot right now…
[20:09:48] <GothAlice> (My IRC client is connected to the bot, not to Freenode. ;)
[20:22:03] <neoromantique> hi
[20:22:07] <neoromantique> I'm confused
[20:22:19] <neoromantique> I've got two db's; db and meteor
[20:22:30] <neoromantique> and I can access db.example just fine
[20:22:39] <neoromantique> but I cannot access meteor.example
[20:22:44] <StephenLynx> because
[20:22:48] <StephenLynx> db is a keyword
[20:22:50] <neoromantique> wah
[20:22:55] <neoromantique> This makes sense now
[20:22:58] <StephenLynx> :v
[20:23:18] <StephenLynx> you should type "use meteor" and then db.collectionName.operation
[20:23:22] <neoromantique> db and meteor's contents are identical so I couldnt know
[20:23:35] <neoromantique> Thanks, it makes sense now
[20:23:38] <StephenLynx> np
[20:34:22] <latestbot> How can I insert from _id from another document into another document at the time of inserting?
[20:34:46] <StephenLynx> you want to insert and read the id of the inserted document?
[20:34:56] <StephenLynx> so you can use it somewhere else?
[20:36:29] <latestbot> actually, never mind. I think I got it
[20:36:59] <StephenLynx> if you are using the node.js driver, it will return the id in the second parameter of the callback.
[20:47:14] <GothAlice> When inserting, one could also just explicitly generate an _id yourself if you want. ;)
[20:49:00] <StephenLynx> that too.
[20:49:18] <StephenLynx> I have the habit of avoiding touching the _id field though.
[21:19:16] <c3l> Hello, the native node.js driver defaults to installing version 1.4.34, is this intended? Is 2.0 not ready for use?
[21:41:04] <NoOutlet> I know it's off-topic, but does anybody know if there is a way to page back some arbitrary number of commands in the python shell?
[22:14:20] <hahuang62> hmm what should I check if I get this error: "$err" : "could not initialize sharding on connection rs1/rs1-1:27017,rs1-2:27017 :: caused by :: specified a different configdb!",
[22:23:17] <devster31> hi, very noob here, but why doesn't mongo support ACID transactions?
[22:34:37] <GothAlice> devster31: For a similar reason to: "pick two: good, fast, or cheap."
[22:36:00] <devster31> ok, so it's part of the CAP thing, you can't have everything, you have to prioritize something
[22:36:13] <GothAlice> devster31: You may find the following resources useful for understanding MongoDB's ACID behaviours: http://css.dzone.com/articles/how-acid-mongodb http://blog.mongodirector.com/atomicity-isolation-concurrency-in-mongodb/ https://groups.google.com/forum/#!topic/mongodb-user/y9YJeZ452lw
[22:36:29] <devster31> thanks, I will read up on that.
[22:36:45] <GothAlice> There's also a 158-slide deck: http://www.slideshare.net/kchodorow/dropping-acid-with-mongodb (has link to the talk, not sure if there's a video, transcript, or audio recording)
[22:38:14] <GothAlice> devster31: Lastly, there *is* an implementation of MongoDB with full transaction support, amongst other goodies: http://www.tokutek.com/2013/04/mongodb-transactions-yes/
[22:38:36] <GothAlice> They manage it by having a radically different way of buffering operations.
[22:53:45] <hahuang62> I keep getting "$err" : "could not initialize sharding on connection rs1/rs1-1:27017,rs1-2:27017 :: caused by :: specified a different configdb!"
[22:53:55] <hahuang62> Any tips? I restarted all the configdbs
[23:34:12] <joannac> hahuang62: check the logs
[23:34:22] <joannac> and stop asking in irc when you have a support contract!
[23:38:15] <GothAlice> joannac: Haah. Does that happen often? XD
[23:40:43] <joannac> GothAlice: yes. and it's very strange because support contracts come with an SLA
[23:41:21] <joannac> and questions in here ...don't
[23:41:41] <Boomtime> questions in here are much more fun
[23:42:00] <Boomtime> the answers can be so wonderfully colourful
[23:42:45] <GothAlice> :D