PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 23rd of July, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:09:23] <naegling> anybody have a clue why these aggregates would return three different numbers of clicks? ---> http://pastebin.com/2GmFT4rn
[01:09:29] <naegling> I'm new to this stuff
[05:22:01] <dgaffney> can anyone explain how --repair goes through and does its job?
[05:22:12] <dgaffney> I have a big old DB that's been sitting on it for 3+ hrs
[05:22:41] <dgaffney> and I'm just wondering when the light at the tunnel will appear as the commands its running (from looking at the log) look remarkably similar from the hour before
[06:03:48] <NaN> is it possible to do an insert from a JSON file in the mongo shell?
[06:36:30] <amitev> hi all
[06:37:10] <amitev> i have a requirement to generate sequential ids and have to guarantee that there will be no records with the same id and there will be no skipped ids in the sequence
[06:37:42] <amitev> i should perform some kind of lock
[06:37:54] <amitev> is there a best practice for that with mongodb?
[07:26:14] <[AD]Turbo> hi there
[07:26:28] <kali> amitev: man, no skipping ? i would not even know how to do it in SQL
[07:30:28] <amitev> kali: by locking the record in the transaction "select for update"
[07:30:54] <amitev> the other transactions will wait
[07:33:13] <kali> amitev: locking is not very mongo-ish, you'll be on your own: you can implement a mutual exclusion with atomic operators on a well known document
[07:33:59] <kali> amitev: for the "working" case, it's pretty straight-forward, but the devil is in the details and the error code path :)
[07:34:47] <_pash> is the _id parameter completely unique, or only unique in the database?
[07:36:11] <kali> _pash: mongodb will enforce its uniqueness on one collection. the rest is up to you
[07:36:47] <_pash> how do i make sure that the _id parameter is completely unique accross all my databases?
[07:37:15] <kali> if you use objectid, that's what you get
[07:38:46] <_pash> kali: if i just inserst into the database, is it completely unique?
[07:42:25] <kali> _pash: it's the generation scheme that ensure uniqueness, not the database
[07:43:40] <_pash> "MongoDB uses ObjectIds as the default value for the _id field if the _id field is not specified" so if i dont specify the _id parameter when I am passing the data, then mongo uses ObjectId(), which is completely unique. Correct? kali
[07:44:11] <kali> yeah
[07:45:17] <Nodex> still haven't read the docs I see
[07:45:19] <_pash> kali: cool. just wanted to clarify before i would create a big mess, thanks!
[07:45:58] <_pash> Nodex: I am reading it, slowly as you see I am quoting them :) As I said, I cant read all the docs in one night.
[07:49:04] <_pash> Nodex: you might think its easy and self explanatory, but as you have said: "I have been doing this for a very very long time". Knowledge = Time and Practice
[07:51:25] <amitev> kali: thank you very much!
[07:52:07] <amitev> kali: i guess that i need something like this - http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/
[07:53:45] <Nodex> _pash : you couldn't even be bothered to read the docs on ensureIndex last night, it explains it better than we can.
[07:54:55] <_pash> Nodex: reading and understading are two different things friend. You cant know if I have read them or not. In fact I have read them.
[07:59:43] <Nodex> I know you didn;t read it because the question you asked made NO sense if you had read it friend
[08:01:04] <kali> amitev: yeah, that will ensure uniqueness, but if for some reason (bug, crash) you can't insert the document after having consumed an int, your sequence will have hole
[08:01:10] <Nodex> exactly the same as if you had read about ObjectId's you wouldv'e known the were unique
[08:01:11] <Nodex> they*
[08:02:02] <amitev> kali: yikes
[08:07:45] <_pash> Nodex: here is the thing, nowadays, reading docs, searching the web, etc, can give any one person an answer to any question. So then what is the point of irc i ask you? To get a real time, live reply, right? Not to get bashed when you come to ask for one. I understand I have to actually start looking at the docs before coming in here, and asking the question first. I shall start that, but it is a subconsious
[08:07:47] <_pash> decision for a search of an answer in the minimal time. Pardon me if you would.
[08:23:47] <Nodex> I am not bashing you, I am asking you to read the docs before you ask a question. Both questions i have seen you ask in 2 days are both covered in the first 5 ilnes of the respective pages in the docs.
[08:35:05] <_pash> Nodex: alright. peace?
[08:41:57] <remonvv> \o
[08:42:08] <Zelest> o/
[08:53:42] <spicewiesel> hi all, I could need some help on deploying a sharded cluster. The first step was the creation of the first replicaset, I did this with auth enabled, so my first question: Do I have to add an admin user one one/all replicaset members or do I have to add this admin user via mongos later.
[09:01:25] <remonvv> http://docs.mongodb.org/manual/tutorial/enable-authentication-in-sharded-cluster/
[09:14:52] <spicewiesel> that's what I did, but I did it while creating the cluster, not as a change later
[09:17:58] <remonvv> spicewiesel, try it and see. I never use auth on dev or production environments.
[09:18:57] <spicewiesel> I added an admin user later, as described in the tutorial, after logging in with that user, I cannot add shards or see the sh.status. I'm not authorized
[09:21:44] <remonvv> What roles does your admin user have?
[09:23:10] <spicewiesel> userAdminAnyDatabase
[09:25:43] <remonvv> you need clusterAdmin
[09:27:55] <elon> Is there any way to insert a document only if it doesn't already exist, apart from find()ing the document and insert when find() returns nothing?
[09:28:43] <spicewiesel> remonvv: ah ok, I'll check that. thanks.
[09:28:46] <remonvv> elon: Yes, upsert
[09:29:12] <elon> remonv: Does that not update the document if it does exist?
[09:29:46] <elon> remonv:"The update() method can either replace the existing document with the new document or update specific fields in the existing document."
[09:30:15] <remonvv> elon: Yes, but you can either not update anything or update fields to what you know would be the correct value.
[09:30:29] <remonvv> elon: This is one of those things where it's easier to tell us what you want to do than how you want to solve the problem.
[09:32:44] <elon> remonvv: I get the idea, and in practice there's no real difference(updating a document with exactly the same values if it exists vs checking if the document exists, and if it doesn't creating one), but I thought there might be a dedicated method that doesn't overwrite anything.
[09:33:01] <elon> remonvv: I'll just use upsert. Thanks for your help
[09:33:51] <remonvv> elon: Hm, there is up to a point. You can use upsert in combination with $setOnInsert
[09:34:00] <remonvv> The latter only writes fields to a newly created document.
[09:34:34] <remonvv> But that's the only operator with the "if new" semantic
[09:38:23] <elon> remonvv: I see. Although I could add every field to $setOnInsert, I doubt there's a significant performance gain(if any!), and it would make my code much less clear. Thanks for looking that up, though.
[09:44:10] <remonvv> elon: There isn't any performance benefit if you're going to insert the entire document, no. And no problem ;)
[11:24:42] <pithagorians> hey folks. i'm new to mongo. i setup a 3 members replication and i kill the mongod process on primary member than start it again and i get in logs recover create file /var/lib/mongodb/local.25 2047MB
[11:24:55] <pithagorians> is it a snapshot in time or ...?
[12:09:36] <spicewiesel> I have 3 clean mongod instacnes, 3 clean configservers and the mongos. I want to set up ohne replicaset now and add it as a shard later. But I do not understand when and where I have to set the adminuser. Do I have to create the replicaset without user? do I have to create the admin user on every single mongod instance? Whould be great if anyone could help me with that.
[12:33:21] <rspijker> spicewiesel: the tutorial should be fairly clear about that
[12:33:57] <rspijker> http://docs.mongodb.org/manual/tutorial/enable-authentication/
[12:34:02] <rspijker> that page and the few after it
[12:34:15] <spicewiesel> to activate authentication is not the problem
[12:35:58] <rspijker> then what is?
[12:39:01] <spicewiesel> do I have to set this user on
[12:39:01] <spicewiesel> a) one of the mongod instances, before/after setting up the rs00
[12:39:01] <spicewiesel> b) one every mongod instances, bevore/after setting up the rs00
[12:39:01] <spicewiesel> c) on mongos, after setting up the rs00
[12:39:01] <spicewiesel> I tried some things now and everytime I ended up in an "not authorized". Other users told me that the userAdminAnyDatabase role isn't enough, but the official tutorial tells to use this one for the admin
[12:40:11] <spicewiesel> I was able to add the admin user on my first mongod instance and it was synced in the rs00, as I was able to connect from the other instances with that credentials. But after that, I was not allowed to to rs.conf() with the admin user...
[12:40:11] <spicewiesel> So, I'm a little bit confused about the right management now
[12:43:27] <rspijker> spicewiesel: ah, okay. Well, I haven't used it myself in a long time, but this is what I remember
[12:43:48] <rspijker> you can just set it on the primary (after or before, shouldn't matter) and it will sync to the others
[12:43:54] <spicewiesel> and, if servers are started wit replSet option, I am not allowed to create an auser ("not master and slaveOk=false"), So I first have to create the rs, then I could create the user. Dunno if that is correct :)
[12:44:21] <rspijker> you should only get that if you try setting a user on a secondary
[12:44:55] <spicewiesel> rspijker: Ok, then it should be ok if I first create the replSet (using the localhost bypass to have the rights) and then I could create the adminsuer on instance1
[12:45:15] <spicewiesel> as there is no replSet at this point, there are no masters and no slaves.
[12:45:50] <spicewiesel> I think, with enabled replSet you have to create that set before creating users
[12:46:53] <rspijker> spicewiesel: if you start with replSet it is a replicated set...
[12:48:18] <spicewiesel> ok. I did rs.initiate and rs.config now, the replSet is now syncing. After that I could create the admin user, not?
[12:52:29] <rspijker> spicewiesel: yep
[12:54:16] <spicewiesel> so, the next question is: wich roles does the admin user need
[12:54:16] <spicewiesel> The tutorial tells userAdminAnyDatabase, users yesterday said it's not enough, and an other howto adds the admin without any specific roles, just with "readOnly" : false
[12:55:09] <rspijker> userAdminAnyDatabase should be fine
[12:56:02] <rspijker> so just do exactly this: http://docs.mongodb.org/manual/tutorial/add-user-administrator/
[12:56:59] <spicewiesel> ok, that's what I did before, let's try again, maybe there was a mistake
[12:57:24] <spicewiesel> but, should I do that on my mongos, or on the mongod instance (f.g. PRIMARY)
[12:58:46] <rspijker> you can do it on the primary
[12:59:54] <spicewiesel> ok
[13:03:38] <Michae___> Hi channel, just looking on db.config.collections and wondering what the the key "unique" is telling me
[13:03:41] <Michae___> http://pastie.org/private/0f1fn0vcgzv4xkf0opi3oq
[13:03:48] <spicewiesel> narf... I switched to db admin and created the user: admin, role "userAdminAnyDatabase". Now I'm no more allowed to use rs.conf()
[13:03:48] <spicewiesel> >> "$err" : "not authorized for query on local.system.replset",
[13:15:11] <Michae___> I know that the underlying index pId is unique, but db.config.collections says unique: false
[13:15:25] <Michae___> do I need to worry about that
[13:27:10] <Mr_O> hi
[13:29:18] <Mr_O> i'm using javascript shell script to do updates on a collection. The db.collection.update does not return any status. How do i get to know if update applied or when somehting goes wrong ?
[13:30:35] <spicewiesel> the mongos knows from the confgdb parameter, where the configservers are running, but where is the connection to the mongod/replSet? I should auth against admin db at mongos to be able to setup my shard, but the auth fails. I think mognos/configsvrs just don't know about the replSet, where my admin user is configured now.
[13:44:20] <quiznilo> if you guys had a reference platform, what would it be?
[13:44:28] <quiznilo> I can't get this to build on a clean gentoo install
[13:44:50] <ron> oh yes, definitely go with gentoo.
[13:44:53] <ron> for everything.
[13:44:55] <quiznilo> x86_64-pc-linux-gnu-g++: internal compiler error: Killed (program cc1plus)
[13:44:58] <quiznilo> woah... ICE
[13:45:02] <quiznilo> well done
[13:45:50] <quiznilo> I suspect...
[13:45:54] <quiznilo> boost
[13:46:03] <cheeser> gentoo++
[13:46:12] <quiznilo> help
[13:47:39] <ron> I need somebody
[13:48:34] <quiznilo> well, most ICEs are from running out of memory
[13:48:35] <quiznilo> oh dear
[13:48:52] <ron> never understood why people use gentoo.
[13:49:01] <ron> it's like they're asking for pain and suffering.
[13:49:02] <quiznilo> control
[13:49:07] <ron> mhmm.
[13:49:09] <quiznilo> heh
[13:49:10] <Derick> it's bad for the environment too
[13:49:12] <ron> keep telling yourself that.
[13:49:25] <quiznilo> usually doesn't give me this much of a headache
[13:49:34] <quiznilo> guys, peace... I like gentoo
[13:49:35] <ron> control. fine. control the inability to compile mongo then.
[13:49:47] <quiznilo> aight
[13:50:23] <cheeser> emerge mongodb
[13:50:29] <cheeser> wait 1.5 days.
[13:50:31] <cheeser> done
[13:50:35] <spacemonkey> haha
[13:50:36] <ron> haha
[13:50:40] <ron> 1.5 days. cute :)
[13:50:48] <cheeser> i have no idea how long it takes.
[13:50:54] <spacemonkey> If you want that kind of control, might as well rock with the BSD boys.
[13:50:58] <ron> doesn't matter really.
[13:51:03] <ron> o/ Derick
[13:51:21] <Derick> what?
[13:51:26] <quiznilo> bunch of haters
[13:51:30] <cheeser> for me it's about the management tools. better than, say, redhat's.
[13:51:32] <cheeser> though when I rebuild my server it'll probably be ubuntu
[13:51:43] <cheeser> 'cause ain't nobody got time for that.
[13:51:46] <Nodex> windows ftw
[13:51:58] <ron> Derick: umm, was just saying hello?
[13:52:30] <Nodex> ron : get a job you bum
[13:52:41] <ron> I still have a job, idiot.
[13:53:20] <Derick> ron: oh hi
[13:53:23] <Nodex> making tea and coffee for people is not a real job
[13:53:39] <rspijker> spicewiesel: sorry, had to step into a meeting. Still problems?
[13:53:43] <ron> so is coding in php.
[13:53:50] <spicewiesel> rspijker: no problem :)
[13:53:50] <ron> besides Derick :)
[13:54:10] <Derick> I mostly *write* PHP, not *in* PHP
[13:54:17] <Nodex> there are those of us that can code and those of us that just make drinks for people ron :)
[13:54:32] <Derick> I'd like a G&T please
[13:54:32] <ron> the fact that you call it 'coding' is sad.
[13:54:34] <Nodex> aka managers
[13:54:49] <ron> Derick: trust me, you don't want me to make you *any* drink ;)
[13:55:06] <Nodex> http://motherboard.vice.com/blog/this-is-what-wi-fi-would-look-like-if-we-could-see-it
[13:55:28] <spicewiesel> rspijker: I'm still trying. if my admin user got that role I'm not allowed to do replicaset stuff. I created the admin without a specific role now, and now I was able to set the replSet. After that I started my configservers, all fine there. Now I started mongos and added my rs00 as shard, that's done, too.
[13:56:00] <spicewiesel> I think I'm still confused. I cannot auth against db admin on mongos with my admin user.
[13:56:45] <rspijker> because your mongos isn't synced
[13:56:54] <rspijker> it's not a part of the replica set
[13:57:06] <rspijker> so adding it to your primary will add it to the secondary (it syncs) but not to the mongos
[13:57:38] <spicewiesel> ok, so how to I get that connection? The WebApp on the mongos server should be able to use the database I will create later.
[13:58:11] <rspijker> afaik you can just create the user on the mongos
[13:58:55] <spicewiesel> ok, than should I see the user management on the mongos completely seperated from the mongod/rs?
[14:02:33] <rspijker> spicewiesel: Come to think of it… I think you need key files for authentication on shared clusters...
[14:02:59] <rspijker> http://docs.mongodb.org/manual/core/sharded-cluster-security/
[14:03:05] <spicewiesel> yes, I'm provided the key file to every component, mongod, mongo-configsvr and mongos
[14:04:20] <spicewiesel> ah, thanks. missed that page until now
[14:05:52] <spicewiesel> ok, so if I add a cluster admin on mongos, it will be stored on the configserver. That's fine, because my next question was "where does mongos store it credentials as it's not using a local data directory?" :)
[14:13:46] <spicewiesel> rspijker: thanks for your help so far!
[14:13:54] <rspijker> sure thing
[14:14:26] <spicewiesel> I have now an admin user for my rs00, and a clusterAdmin, created on mongos.
[14:17:17] <spicewiesel> now I have to solve the next problem, the new clusterAdmin is not allowed to execute sh.status(), as it's "not authorized for query on config.version". Same with show dbs and other commands :(
[14:18:14] <rspijker> where/how are you authing and where are you executing the query?
[14:20:20] <spicewiesel> I tried that on the mongos host:
[14:20:20] <spicewiesel> 1) mongo admin -u admin -p
[14:20:20] <spicewiesel> 2) mongo > db.auth( "clusterAdmin", "secret" )
[14:20:44] <spicewiesel> both seems to be fine, then I tried to get the status of my shard added earlier.
[14:21:43] <rspijker> what are the roles for the clusterAdmin?
[14:22:25] <spicewiesel> userAdminAnyDatabase, as told here http://docs.mongodb.org/manual/tutorial/add-user-administrator/
[14:23:28] <spicewiesel> I swtiched to db admin and executed: db.addUser( { user: "clusterAdmin", pwd: "secret", roles: [ "userAdminAnyDatabase" ] } )
[14:24:16] <rspijker> which makes it a userAdmin...
[14:24:20] <rspijker> that's not what you want
[14:24:49] <rspijker> userAdmins only have user administration priviliges
[14:24:55] <spicewiesel> yes, that's what I'm thinking, too.
[14:24:59] <rspijker> (meaning they can increase their own privileges)
[14:25:11] <rspijker> you probably want the clusterAdmin role
[14:25:14] <rspijker> http://docs.mongodb.org/manual/reference/user-privileges/
[14:25:16] <rspijker> handy overview there
[14:25:48] <spicewiesel> thanks again
[14:26:30] <spicewiesel> I would like to habe a admin user, later I need a database and a user the app could use to work with that new db
[14:41:39] <spicewiesel> rspijker: ha! I think that's it :)
[14:42:05] <rspijker> good :)
[14:42:55] <spicewiesel> the last step would be to find the correct roles for the application user, should be readWrite on it's database, right?
[14:43:10] <DestinyAwaits> when is the 10gen online training getting started?
[14:43:31] <spicewiesel> DestinyAwaits: last week, today is lesson2, but you could still join.
[14:43:57] <DestinyAwaits> ah it started :(
[14:44:06] <DestinyAwaits> not a problem will join it
[14:44:12] <DestinyAwaits> Thanks spicewiesel :)
[14:44:24] <spicewiesel> "By the way, one can still sign up for the course at this point so tell your friends!" from todays newsletter :)
[14:44:29] <spicewiesel> DestinyAwaits: you're welcome
[14:47:56] <DestinyAwaits> spicewiesel: Mate its showing Jul 29, 2013 to me?
[14:48:19] <DestinyAwaits> I enrolled for M101J: MongoDB for Java Developers
[14:49:32] <spicewiesel> ah ok, me M102 :)
[14:49:57] <DestinyAwaits> heh ok.. I got scared.. :)
[14:50:29] <spicewiesel> sry :)
[14:52:05] <DestinyAwaits> spicewiesel: no.. it's ok friend... I should have told you what Course I have enrolled for.. :)
[14:53:14] <spicewiesel> yeah, that's this weird human communication :)
[14:55:02] <DestinyAwaits> heh
[15:09:53] <Dreamer3> ERROR: BSON::InvalidKeyName:key Dealer.com must not contain '.' - can anyone point me to the commit that started causing this?
[15:10:15] <Dreamer3> we were using mongo / bson 1.6.2 ruby gems now that we're on 1.8.6 this is cropping up, but i can't find the commit that changed it
[15:11:56] <Dreamer3> far as i can tell the code has been in cbson for a long time
[15:17:14] <rspijker> Dreamer3: you shouldn't use dots in field names
[15:17:27] <rspijker> since it's the mechanism used to address fields within a document
[15:17:27] <Dreamer3> i get that, but i want to read the code changes that caused this
[15:17:36] <Dreamer3> right, but it's worked fine for years
[15:17:40] <rspijker> way back when some drivers allowed it
[15:17:41] <Dreamer3> when used in hash keys
[15:17:46] <rspijker> it was never a good idea
[15:17:50] <Dreamer3> not saying it was
[15:18:28] <Dreamer3> can you point me to the commit or which version this changed in?
[15:18:34] <rspijker> Like I said, some drivers used to allow it. not 100% sure but I think it's still not enforced by mongos, only the driver
[15:18:55] <Dreamer3> right, we didn't change mongo versions, so that can't be the problem… mongo definitely allows it
[15:19:09] <Dreamer3> old values are read just fine
[15:20:26] <rspijker> Dreamer3: so, the driver then… which one are you using?
[15:22:02] <Dreamer3> ruby
[15:23:00] <rspijker> https://jira.mongodb.org/browse/RUBY-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
[15:23:04] <rspijker> that looks related then...
[15:25:15] <Dreamer3> thanks, i'm reviewing those changes now
[15:28:59] <Dreamer3> https://github.com/mongodb/mongo-ruby-driver/commit/4cc201a9dd2a6e67738a3803a8954acd06bd1496
[15:29:39] <Dreamer3> before that keys were never checked
[16:04:57] <mdeboard> How do I deal with results returned from Casbah (Scala client)? It's just returning plain objects, and nested properties are quite difficult to work with, requiring manual finagling
[16:05:31] <mdeboard> I don't mind rolling my own solution but I'd like to make sure I'm not missing something obvious
[16:05:43] <mdeboard> Also how do I compare dates and so forth? The documentation is very unclear
[16:05:51] <mdeboard> the comparison operator documentation specifically
[16:07:43] <mdeboard> http://mongodb.github.io/casbah/guide/querying.html#query-operations as well, should I just give up and go read the Java driver docs?
[16:10:06] <rspijker> I've never worked with Casbah, sorry :(
[16:10:53] <rspijker> https://groups.google.com/forum/#!forum/mongodb-casbah-users
[16:11:04] <rspijker> that should probably be your best resource though if you want to stick with it
[17:22:17] <__ls> hi everyone; i'm having an "BSONObj size is invalid" assertion error; i tried db.repairDatabase() but the issue persists. here's the offending code: http://pastie.org/8168046, and here's the error log: http://pastie.org/8168038
[17:23:46] <__ls> the error doesn't occur if i request 1700 instead of 1800 documents, but I'm not sure it's strictly a size issue; it might just be that somewhere in the final 100 there's a corrupted document in there (maybe?)
[17:24:54] <__ls> intuitively, the log "First element: ns: "esri.block_group"" would speak for something non-document specific (I've found other logs from people where the "first element" was an actual document), but then again, this is way beyond my mongodb knowledge ...
[17:27:41] <Kanara> can anyone point a newbie to info on why save() & insert() in node.js would complete happily but not store any data?
[17:28:09] <Kanara> (completely empty db)
[17:42:00] <zachrab> so im saving a Time.now stamp in ruby to a document in mongodb and it converts it to a ISODate
[18:26:37] <astropriate> It is official!
[18:26:48] <astropriate> The C++ mongodb driver was written by a dunk monkey
[18:27:00] <astropriate> drunk*
[18:27:04] <cheeser> irony++
[18:27:33] <astropriate> spelling != drunk
[18:27:43] <astropriate> inconsistent API does :)
[18:27:57] <astropriate> inconsistent is such a nice word to describe it
[19:05:36] <Kanara> does mongo actually work? nothing I do, even tutorials will save any data
[19:05:48] <cheeser> of course, it does
[19:06:00] <Kanara> all platforms?
[19:06:44] <cheeser> yep
[19:06:44] <cheeser> well, all supported platforms.
[19:10:31] <Kanara> its really strange, no errors or feedback of any kind, just runs through the script quite happily but nothing gets inserted
[19:12:32] <Kanara> seems a common issue though
[19:17:23] <beniwzb> Hi all, there's something I'm missing about the docs. I have created an admin user, which has the following privileges: "userAdminAnyDatabase", "userAdmin", "readWriteAnyDatabase", "dbAdminAnyDatabase", "clusterAdmin" , however, if I connect with the mongo command line client I get: connecting to: test authentication fails (code 18) anything I'm missing here?
[19:18:15] <beniwzb> Also for completeness: If i us "admin" as the database on the command line, the client connects fine and I can see all databases
[19:35:41] <Kanara> ok, the mystery deepens. if i connect to "database1" which has been accessed by the node app I cant insert but if i connect to a new database i can, until the node app connects then the db becomes permenantly useless
[19:37:50] <Kanara> http://pastebin.com/hW2tyY4D
[19:52:05] <bcave> hi everyone
[20:53:34] <jcromartie> are there any problems with using collection names that contain dots, hyphens, etc?
[20:53:46] <jcromartie> I want to use collection names based on domains
[20:54:16] <jcromartie> in my simple tests it works fine but I just want to make sure there isn't some edge case where it fails
[20:55:48] <kali> jcromartie: don't do it.
[20:55:58] <kali> jcromartie: it's gonna drive you ma
[20:55:59] <kali> d
[20:56:11] <jcromartie> kali: any particular reason?
[20:56:35] <kali> no showstopper, but about a dozen little thing will become less convenient
[20:56:40] <jcromartie> like?
[20:56:40] <kali> particularly the shell
[20:56:47] <jcromartie> oh that's no big deal
[20:56:57] <jcromartie> db["example.com"] instead of db.exampledotcom
[20:57:15] <kali> yeah, that kind of stuff
[20:57:26] <jcromartie> OK that's not breaking Mongo as far as I'm concerned
[20:57:44] <jcromartie> I'm primarily using this from Clojure where hyphens and dots in symbols and keywords are not a problem
[20:57:51] <kali> no, as far as i know everything still works but becomes frustrating :)
[20:58:21] <kali> but don't use dot in db names or field name. that will break stuff
[20:58:26] <kali> collection names are fine
[20:59:39] <jcromartie> yeah really?
[21:00:09] <kali> yes. dot in field name will break dot notation for queries and updates
[21:00:29] <kali> so it's explicitely forbidden (but mongodb may let you shoot yourself in the foot)
[21:01:55] <kali> jcromartie: http://docs.mongodb.org/manual/reference/limits/#naming-restrictions
[21:04:17] <jcromartie> ah ha
[21:04:20] <jcromartie> this is perfect
[21:04:59] <jcromartie> thanks kali, this clears everything up
[21:05:20] <kali> jcromartie: uw
[21:42:40] <VarunVijayarghav> When doing an endureIndex(), is there a difference between doing ensureIndex({timestamp: 1}) vs ensureIndex({timestamp : -1})
[21:43:03] <VarunVijayarghav> assuming timestamp is an ISODate object
[21:48:40] <cheeser> VarunVijayarghav: not in practice, no, i don't think.
[21:49:01] <cheeser> there might be some nuance to how you query or order, though.
[21:51:12] <jcromartie> kali: by the way, you *can* use dots in collection names at the shell
[21:51:15] <jcromartie> without ["foo"]
[21:51:29] <jcromartie> i.e. db.foo.bar.insert() db.foo.bar.find() work
[21:51:42] <jcromartie> and db.foo.bar === db["foo.bar"]
[21:51:44] <cheeser> it's the field names where the parser can get confused.
[21:51:57] <jcromartie> not really though
[21:52:00] <jcromartie> sorry
[21:52:02] <jcromartie> not really ===
[21:52:23] <jcromartie> cheeser: yeah, but I don't care too much about field names except for the hard limitations
[21:52:43] <jcromartie> but docs say "Field names cannot contain dots"
[21:52:49] <jcromartie> so that's not about confusion, just a hard limit
[21:53:11] <jcromartie> it throws an exception on insert
[21:54:20] <cheeser> right. it's a restriction for a reason
[21:54:43] <jcromartie> sure, but it's not really about parser getting confused...
[21:54:57] <cheeser> actually, i'm reasonably sure it is.
[21:55:16] <cheeser> at least in part
[22:00:38] <jwm> I'm trying to use mongoose findById
[22:00:48] <jwm> I've got a string that is in the collection
[22:00:53] <jwm> but findById returns zero docs
[22:01:08] <jwm> I can do a find({}) and find it that way with comparing id fields to the string
[22:01:14] <jwm> anything to look at?
[22:01:31] <jwm> I'm really at a loss here it is weird
[22:02:04] <cheeser> can you pastebin the document?
[22:02:28] <jwm> sure
[22:03:10] <jwm> http://pastebin.com/ECkjNv9a
[22:03:13] <jwm> there is my schema
[22:03:19] <jwm> pasting my doc here in a sec
[22:04:16] <jwm> ;2~
[22:04:18] <jwm> http://pastebin.com/p7zc4wtD
[22:04:22] <jwm> there is my collection
[22:04:50] <jwm> I just can't lookup by id
[22:04:57] <jwm> if I pass one of the other parameters it works
[22:04:57] <cheeser> when you call findById() are you passing a string or an ObjectId?
[22:04:59] <jwm> like ip
[22:05:05] <jwm> I've tried both
[22:05:14] <jwm> I cast to objectid or just the string
[22:05:32] <jwm> I figured findById also casts for me
[22:05:41] <jwm> since that is what google says :)
[22:06:12] <jwm> ohh crap
[22:06:15] <jwm> I just realized something
[22:06:17] <jwm> thank you
[22:06:23] <jwm> the id got saved non object id
[22:06:25] <jwm> heh
[22:06:28] <cheeser> :)
[22:06:29] <jwm> wtf
[22:06:37] <jwm> damn I have got to paste stuff more often
[22:06:43] <jwm> I am not sure how that even happened
[22:06:44] <jwm> heh
[22:06:59] <cheeser> or get a rubber duck: https://en.wikipedia.org/wiki/Rubber_duck_debugging
[22:06:59] <jwm> probably on my save
[22:07:23] <jwm> actually now that leads to wtf I have a string instead of an objectid
[22:07:25] <jwm> heheh
[22:08:13] <jwm> yeah my rubber duck is in the shop
[22:16:43] <giraffeslacks> hi. i'm building a ticketing system and am fairly unfamiliar with the mongodb paradigm. generally tickets get a unique sequential ID. mongodb doesn't do it without workarounds and to the detriment of scalability (according to the research I've done.)
[22:17:13] <giraffeslacks> so i'd like to do this a more appropriate way from the start. any suggestions on how to use _id to represent/generate a human-readable ID?
[22:17:46] <giraffeslacks> i was thinking of displaying just the last 5-6 digits of the _id... but that seems like a plan for failure (even if a collision might be extremely unlikely.)
[22:18:05] <preaction> giraffeslacks: the ORM i'm using does it for me, but it still has the _id. keep the _id, add a number field
[22:18:36] <jwm> just make your own id
[22:18:42] <jwm> might be easier
[22:19:10] <giraffeslacks> ok. thought i'd check to see if there was another method out there.
[22:19:23] <cheeser> mongo doesn't have a sequence, no.
[22:19:36] <cheeser> though you could probably fake it using findAndModify()
[22:19:46] <giraffeslacks> cheeser: yeah. i didn't want to write my own (even though the mongo docs explain it pretty well.)
[22:20:10] <cheeser> giraffeslacks: kudos on the surreal nick
[22:20:24] <giraffeslacks> cheeser: lol thanks!
[22:20:41] <cheeser> and for not going with something as banal and predictable as giraffescarves
[22:21:28] <giraffeslacks> seems those are real things... haha
[22:35:55] <jwm> if I am taking a sub document
[22:36:01] <jwm> and inserting it as a top level document
[22:37:26] <jwm> anything to worry about
[22:37:34] <jwm> that might be what caused my objectid to become a string
[22:37:39] <jwm> not certain testing still heh
[22:39:53] <jwm> I strip the id from the parent object using findone(.., { _id: 0 }
[22:57:27] <tphummel> i'm curious. in the config db, what does a lock with state: 0 mean?
[22:57:31] <tphummel> inactive?
[23:05:40] <zachrab> how can i do regex in mongodb
[23:05:41] <zachrab> ?
[23:06:09] <tphummel> zachrab: http://docs.mongodb.org/manual/reference/operator/regex/
[23:06:19] <zachrab> tphummel: looking at that
[23:07:36] <zachrab> but an example
[23:07:56] <zachrab> db.collection.find( { field: /*a*/i } );
[23:08:05] <zachrab> would return anything with a in it?
[23:10:06] <tphummel> zachrab: there are some good regex tutorials on the web if you do a search.
[23:10:14] <tphummel> zachrab: here is one http://www.regular-expressions.info/tutorial.html
[23:14:28] <zachrab> i tried /*keyword*/i however it was not valid?
[23:22:02] <zachrab> anyone know the correct syntax
[23:31:53] <VarunVijayarghav> @cheeser thanks. Just saw your reply regarding the indexing.
[23:32:55] <joannac> zachrab: WFM. What exactly are you trying?
[23:35:13] <zachrab> joannac: WFM?
[23:37:59] <joannac> zachrab: works for me
[23:47:14] <cheeser> VarunVijayarghav: np