[04:19:59] <unpro> would findOne({'md5': '12345678901234567890123456789012'} where md5 is a text indexed field be reasonable, and always return a complete text match?
[04:20:12] <unpro> (i'm wondering if its getting hashed internally and truncated)
[04:20:38] <unpro> because ive got like 8million documents, and i'm expereincing some weird behavior
[04:20:40] <joannac> why is it text indexed if you want to do exact matches?
[04:31:39] <joannac> In any case, that search should work
[04:36:32] <unpro> could it be something with the create_index vs ensure_index?
[04:37:34] <unpro> becuase i swear, i have assert() in place that verifies that the find_one for the field/value returns None, and then hits when I do it a 2nd time >_>
[04:37:49] <unpro> unless its some *cursed* whitespace
[05:12:33] <mehwork> when i try to create a sparse index, nothing seems to happen. Do you have to create the index manually first, then specify that it's sparse later?
[05:16:28] <joannac> mehwork: what are you expecting to happen?
[05:16:40] <joannac> mehwork: does it show up in db.coll.getIndexes() ?
[05:18:31] <mehwork> joannac: i want it to show up in getIndexes but it's not
[05:22:20] <joannac> pastebin what you're running, and the output of db.coll.getIndexes()
[05:22:41] <mehwork> "Some options that you can specify to ensureIndex() options control the properties of the index, which are not index creation options. For example, the unique option affects the behavior of the index after creation."
[05:23:16] <mehwork> doesn't that mean i can't create the index with {unique: true} at the same time i create the index?
[08:15:49] <sachinaddy> how to group data in mongodb?
[08:17:24] <Soothsayer> I am creating a Collection which stores all URLs (for URL rewriting).. I was thinking of having the _id field in the Document schema as an md5 of the URL
[08:17:35] <Soothsayer> is this a sound implementation?
[08:56:33] <Soothsayer> glontu: unless you query it in your app, sort it and place it back.
[08:56:44] <Soothsayer> but then you can’t use commands to add to it
[08:56:59] <Soothsayer> glontu: why do you need sub-documents sorted?
[08:57:50] <glontu> Soothsayer, i need to recheck the collection of subdocuments when i add or remove one of them. When i add one, if the new document is "better" than all others i need to make the previous best as not best anymore
[08:58:23] <glontu> when i remove a subdoc, i need to decide again if the "best" had changed and redo the subdocs properties
[08:58:47] <glontu> so i want to sort them by the isBest property
[08:59:08] <Soothsayer> glontu: and you want to do addition and removal without a read?
[09:00:07] <glontu> Soothsayer, i am in symfony so i figure that if i manage the subdocs in the owning docs add... and remove... methods it will get flushed anyway right after that
[09:01:32] <Soothsayer> glontu: you will not be able to achieve this if you do your adds / removes via the ODM
[09:01:34] <Soothsayer> here’s what I suggest you do
[09:01:57] <Soothsayer> to each of your sub-documents, add an ‘id’ field which is some kind of id/hash which needs to only be unique among the sub-documents of that document.
[09:02:33] <Soothsayer> next, when you query the Document.. you can loop through the sub-documents in symfony and check what’s the next best sub-document
[09:03:47] <Soothsayer> and then remove whatever you want to remove using the $pull command with the ‘id’ field of the sub-document
[09:03:55] <Soothsayer> for additions you don’t have to do anything special.
[09:04:09] <Soothsayer> lastly, i would suggest storing the ‘id’ to the isBest sub-document in the main Document somewhere
[09:04:33] <glontu> Soothsayer, but i don't want to remove them. i just want to update the previos "best" as not best anymore and add the new one as best.
[09:04:47] <Soothsayer> glontu: then its simpler all the more.. manage it in a separate field
[09:04:55] <Soothsayer> not inside the sub-documents
[09:05:02] <glontu> ok so main doc holds ref to the embedded best doc
[09:05:05] <Soothsayer> create a bestSubdocumentId
[09:05:16] <Soothsayer> yes, to the new ‘id’ field you created, and NOT the position of it.
[09:05:51] <glontu> ok, thanks, i'll give it a try.
[09:05:51] <Soothsayer> glontu: hint, use Symfony2’s Symfony\Component\Security\Core\Util\SecureRandom
[09:06:29] <Soothsayer> glontu: this will come in handy http://pastie.org/9662516
[09:08:10] <glontu> one more thing. since i give them the id can the best document be mapped as an embedsone and reference the same subdocument from the collection ?
[09:09:20] <Soothsayer> glontu: there is no provision in MongoDB or Doctrine ODM to reference embedded sub-documents
[09:30:17] <af__> guys in oplog, the timestamp is saved as "ts" : Timestamp(1395663575, 1),.... I believe '1395663575' is in unix time.. but what is '1'... ? and also how do I access it in Pymongo?
[09:53:39] <_R_B_R> Hi all, I started looking at mongodb yesterday and it seems really good. Only trouble is, I want to be able to retrieve a single record from a sorted table in a fraction of a second. This is a (possibly terrible) code I've written to do this: http://pastebin.com/Rh8JMbPi
[09:54:52] <_R_B_R> I indexed the property and that did improve performance quite a bit
[09:55:06] <_R_B_R> Just wondering if there's anything else I can do to make it go quicker
[09:56:41] <_R_B_R> The reason I'm doing this is because I want the user to be able to hover their mouse over a horizontal bar representing the whole dataset and for a tooltip to display what the value is at that position.
[09:57:32] <_R_B_R> At the beginning of the dataset queries are fast, but once I get past a few hundred thousand I begin to get some lag
[12:57:34] <_R_B_R> is there a way of querying by index?
[12:59:17] <kali> _R_B_R: just create the index, the optimizer will do the rest
[12:59:34] <skot> Yes, query using an indexed field. You should not use skip to get to the nth item. Do you know anything about the document you are looking for, like its _id value?
[13:02:12] <_R_B_R> yea that skip function is too slow
[13:03:14] <_R_B_R> but I suppose the _id value doesn't just go 0, 1, 2 ... etc .. ?
[13:03:17] <skot> using skip requires "skipping" all the previous value which is going to cause way more work than you need, hence the suggestion to use range based pagination, by using a query instead of skip to get where you want to go
[13:04:10] <skot> Go research how to do pagination without using skip/limit. There are lots of solutions/suggestions and they are for more than just mongodb.
[13:43:55] <mskalick> could I have a question? - are test in mongodb 2.6.x functional and maintained?... thanks
[13:48:46] <cheeser> as in, does the server have tests that are maintained and run as part of the build?
[13:58:27] <mskalick> I've built MongoDB from source files and run "python buildscripts/smoke.py --mongod `which mongod` --mongo `which mongo` --dont-start-mongod --port 27017 --mode suite all" from that directory
[13:58:42] <mskalick> and almost every test suite failed...
[14:19:01] <dump> mskalick: Have you checked the RPMs packages at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux
[14:20:05] <mskalick> thanks, but I am packaging it for Fedora, so I have to have a spec file
[14:20:47] <mskalick> and test aren't passing for me
[14:32:50] <dimon222-cloud> i may be missleading, but why " --dont-start-mongod" ?
[14:34:41] <cheeser> mskalick: you should post to the dev list then
[14:46:03] <mskalick> dimon222-cloud: because I have already running one mongod instance (but I've tried it also without it...)
[14:58:55] <dggb> I have a real time service that logs 40 items from a remote sensor node every minute. Could anyone give me some suggestions on document design>
[17:06:01] <globaly> hello dears, how is it possible to return the number of distinct values in the command db.collection1.runCommand( { distinct: 'collection1', key: 'title'});
[18:07:05] <doug1> Looking at cookbook code, I see it's trying to connect as the admin user. If I do a 'mongo -u admin' without a password at the prompt, it fails.. says it requires a password, but none has been set up yet so I assume the cookbook would fail for the same reason
[18:08:24] <ceejh> I just need an idea of your setup. Mongod, mongos, config sirs, or just a standalone node?
[18:08:37] <ceejh> *servers... auto correct is killing me today
[18:09:05] <doug1> ceejh: full on setup. I've brought up 3 config servers, and this error happens on one of the data nodes. There's three of them. Haven't created the router yet
[18:09:31] <doug1> ceejh: Will eventually be 3 config servers, 2 shards of 3 nodes each and some number of routers
[18:09:57] <ceejh> so the config servers come up fine, then you start bringing up the mongod servers and it fails
[18:10:00] <doug1> The router, which creates the password for the admin user hasn't been created yet, it gets done last
[18:10:27] <ceejh> Are you using the master branch of the cookbook?
[18:10:54] <ceejh> And I assume you're using the user management recipe on purpose because you want to initialize the admin
[18:11:01] <doug1> ceejh: from a month or two ago yes, but I had to fork it locally and make changes because there's bugs in the replica set naming. grrr
[18:11:24] <doug1> user management... actually no.
[18:11:54] <ceejh> Hmm, so you're setting node[mongodb][config][auth] true on your own?
[18:11:57] <doug1> ceejh: for now... we have to put the router on a rightscale box (legacy) so there was scripts to create the admin user etc
[18:12:12] <doug1> ceejh: actually I didn't modify that attribute...
[18:12:36] <ceejh> O_o your mongo instance must be running with auth=true to say it requires authentication
[18:12:41] <ceejh> or... unless you have a key file I guess
[18:12:47] <ceejh> Which would make sense in a cluster
[18:12:53] <doug1> ceejh: it's not in the wrapper cookbook...
[18:13:22] <doug1> and it's nowhere in the mongo cookbook's attributes . just checked
[18:13:34] <ceejh> Are you setting a key file though?
[18:13:43] <ceejh> That automatically set auth=true
[18:14:41] <doug1> i'm confused tho... if I set the key file and the cookbook auto sets auth, what happens initially when the nodes are being created, before the admin user password has been set?
[18:15:16] <ceejh> Just to answer that generally, you won't be able to do any command except db.createUser
[18:15:22] <ceejh> Because of the localhost exception
[18:18:27] <ceejh> So... I confused you more than I helped. Well my job is done here
[18:18:54] <doug1> The docs have "node['mongodb']['admin']" The admin user with userAdmin privileges that allows user management .... but nothing about how to assign privs to it
[18:19:12] <doug1> i don't think it's you. mongo auth is confusing in general
[18:19:20] <ceejh> It sounds like you don't have that recipe, right, and trying to change things over to it might be more trouble than it's worth
[18:19:37] <doug1> ceejh: i've been working on this for 4 months now. :(
[18:19:39] <ceejh> (Because if you pull straight from berkshelf, you get the last tagged version, you'd have to pull straight from git to get latest)
[18:20:19] <doug1> I just did a git pull a month or two ago. i had to fork because it straight up doesn't work with the way the replicaset names are done
[18:25:00] <doug1> ceejh: last change to that file was 4 months ago. That's def earlier than my last pull where it still had it. wish I could remember what I changed
[18:29:48] <doug1> there's no mention of a password attribute for the user in the docs. grrrrr
[18:30:03] <ceejh> I don't know what docs you're reading...
[18:30:13] <ceejh> "Before using on a new database, ensure you're overwriting the node['mongodb']['admin']['username'] and node['mongodb']['admin']['password'] to something besides their default values."
[18:33:32] <ceejh> I wasn't able to get a cluster of mongo working at the time, so getting it working with multiple nodes came later
[18:34:21] <doug1> people expect me to get this to work, so I go to the cookbook and there's nothing there about all the issues. I start playing with it, it works, confidence builds and then for some reason it stops working.
[18:34:57] <doug1> which then makes me look like an idiot because people assume i either never had it working, or... i dunno, i'm just an idiot or something
[18:36:01] <doug1> the frustrating part is that I did have it working at one point
[19:26:30] <huleo> I'm wondering if querying by $text is possible using regex
[19:31:10] <Forest> Hello,i am getting issue Can't insert document: WSARecv tcp 127.0.0.1:28406: An existing connection was forcibly closed by th e remote host. What can be the problem?
[19:38:28] <while1eq1_> how can I tell how far along a slave is during the "inital sync"
[19:39:05] <Forest> nobody knows what might me the issue? why Mongo disconnects me?
[20:06:55] <Neal_> I have two collections: User and Subscription. I want each Subscription to "link" to a User somehow. I am very new to mongo and just want the best way of doing this.
[20:09:08] <Neal_> In the Subscription schema, can I have something like "user: { type: ObjectID }" and whenever I create a Subscription, I make that ObjectID a users' _id?
[20:12:16] <eucalyptus> anyone using the mongo-hadoop-connector?
[20:22:38] <cheeser> eucalyptus: you're more likely to get answers with actual questions...
[21:24:22] <doug1> Anyone here using MMS? Playing with GUI. It makes no sense at all'
[22:02:35] <DrakeL> Hi everyone! I've been using MongoDB for a while and it's great. The only problem I seem to have is... I have no clue how authentication works.
[22:03:06] <DrakeL> I'm trying to have an admin (superuser) access for myself to all databases, and one user to access one database read/write.
[22:15:37] <doug1> right now I'd like some docs on MMS.
[22:15:56] <Boomtime> that's probably a fair cop, I understand those are not very complete
[22:16:43] <doug1> I've been looking at how to create a cluster for an hour and I can't find it. when you can't create a cluster via a GUI, I'd call that a fail
[22:17:24] <Boomtime> trying with automation then i take it
[22:17:45] <doug1> Boomtime: ? I was trying with chef and that's been an unpleasant experience
[22:18:15] <Boomtime> what has Chef got to do with MMS?
[22:18:29] <Boomtime> it sounds like your problem is with chef
[22:18:36] <doug1> Boomtime: Nothing. I was trying to deploy the cluster with chef. MMS is an act of desperation.
[22:18:58] <DrakeL> This is really quite frusturating
[22:20:43] <doug1> Boomtime: Or, where are the docs that tell me how to create a cluster in the MMS GUI?
[22:21:41] <DrakeL> Sorry. Err. I'm able to create a superuser account with unrestricted access, but I cannot log into the account with the mongo command or in a visual thing like Robomongo.
[22:21:58] <doug1> DrakeL: Did you set a password?
[22:22:25] <DrakeL> I think so? I defined it in the whole db.createUser thing
[22:22:48] <doug1> DrakeL: not a network connectivity issue?
[22:25:16] <DrakeL> I was running a semi-production mongodb instance with noauth and connections allowed from anywhere. I figured that I should probably get some authentication.
[23:12:42] <doug1> eg: if the docs said the correct order to start instances in a cluster, and what instance to run the useradd command on, it would help in debugging the cookbook
[23:16:14] <Boomtime> doug1: this document tells you quite explicitly trhe order of servers: docs.mongodb.org/manual/tutorial/deploy-shard-cluster
[23:16:37] <Boomtime> this document tells you quite explicitly how to enable auth in a sharded cluster: http://docs.mongodb.org/manual/tutorial/enable-authentication-in-sharded-cluster/
[23:17:53] <DrakeL> Boomtime: I tried adding a user with this form: https://gist.github.com/ihatecsv/18908ec6fa0307fb9809 and it executes fine but when I'm in the Laxatus database and do db.system.users.find() it returns nothing
[23:21:36] <Boomtime> DrakeL: have you tried db.getUsers() ?