PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 7th of March, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:35:52] <gsd> if im connecting to multiple hosts, do i need to prepend user@pass: to each host in the connection string
[00:45:47] <sheki> hey i have a query which looks like { a : "some string", b : {$gt : new Date(1393229650673)}} =>
[00:45:52] <sheki> i am looking to add an compound index
[00:45:57] <sheki> what should the compound index be.
[00:46:17] <sheki> from what i know the index should be { a : 1, b :1 },
[00:46:33] <sheki> does the order on field b matter?
[01:57:59] <ben2> hey all, I have a collection of users with many fields I need to filter by. I want to select data from a log collection that belongs only to the subset of users I filtered by. Some filters can return 100k users which seems like a lot of data to send back and forth if I were to first select all the user_ids (all 100k) and use that to filter log data. Is there a better way to handle this?
[02:47:19] <the8thbit> I'm having trouble connecting to my mongodb on an openshift account. When I ssh in and try to enter the mongo shell I get:
[02:47:20] <the8thbit> Thu Mar 6 21:32:01.272 Error: 18 { code: 18, ok: 0.0, errmsg: "auth fails" } at src/mongo/shell/db.js:228
[02:47:28] <the8thbit> exception: login failed
[02:47:48] <the8thbit> anyone have any ideas?
[03:10:08] <joannac> the8thbit: umm, auth as one of your database users?
[03:10:22] <the8thbit> joannac: No, admin is my db user
[03:10:39] <the8thbit> Its saying that the authentication is failing, as far as I can tell
[03:10:47] <joannac> yes
[03:11:59] <the8thbit> oh, I misread you
[03:11:59] <the8thbit> joannac: What command would I issue to do that?
[03:12:01] <the8thbit> mongo -u username -p pass?
[03:12:02] <joannac> you starting with something like `mongo -u admin -p password`
[03:12:09] <joannac> yes
[03:12:19] <the8thbit> cool, lucky guess :)
[03:12:20] <the8thbit> thanks
[03:13:22] <the8thbit> joannac: I'm also getting an error any time I try to do a get query, so if all I need to do is supply credentials there then I dont think the issues are related
[03:13:57] <joannac> the8thbit: a 'get' query?
[03:16:05] <the8thbit> joannac: The exact error is:
[03:16:06] <the8thbit> MongoError: not authorized for query on chatappdb.users
[03:16:19] <the8thbit> I get it when I attempt $.get() in my client code
[03:16:28] <joannac> the8thbit: what user are you authing with?
[03:16:33] <the8thbit> admin
[03:16:34] <joannac> and what permissions do they have?
[03:16:51] <the8thbit> they should have admin permissions? Not sure.
[03:16:58] <joannac> find out
[03:17:04] <the8thbit> l
[03:17:05] <the8thbit> k
[03:18:14] <the8thbit> joannac: readOnly is false for admin, is that what I'm looking for, or is there more somewhere else?
[03:20:41] <joannac> what version are you running?
[03:20:58] <joannac> can you just pastebin the full document?
[03:21:06] <joannac> remove the password field if you're concerned
[03:21:32] <the8thbit> joannac: 2.4
[03:21:33] <the8thbit> and sure
[03:23:16] <the8thbit> joannac: http://pastebin.com/TPi5bg6a
[03:23:48] <the8thbit> is pwd the field for password? Because it wasn't what it was supposed to be, but I assume its salted?
[03:24:01] <joannac> tes
[03:24:10] <joannac> okay
[03:24:21] <joannac> that's a non-readOnly user on the admin database
[03:24:28] <joannac> that doesn't get you anything on any other database
[03:24:42] <the8thbit> ah
[03:24:44] <joannac> add a new user and use the new-style of users: http://docs.mongodb.org/manual/reference/method/db.addUser/
[03:29:36] <the8thbit> joannac: So when I check my collections, I notice that I don't have the same collections that I do when I test locally
[03:29:56] <the8thbit> locally I have:
[03:29:58] <the8thbit> system.indexes
[03:29:59] <the8thbit> users
[03:30:21] <the8thbit> on openshift, I have:
[03:30:23] <the8thbit> openshift
[03:30:23] <the8thbit> system.indexes
[03:30:23] <the8thbit> system.users
[03:31:00] <the8thbit> on the local one I don't have any db users and the users collection is a collection I made for holding users of the application
[03:31:29] <the8thbit> so that's not in my remote db, and I'm not sure how to add it
[03:32:38] <joannac> you're not meant to have a db called users
[03:32:46] <joannac> each database has a collection called system.users
[03:33:12] <the8thbit> its not a db called users, its a collection called users
[03:33:50] <joannac> ...that's great, but that's not what mongodb uses
[03:34:48] <the8thbit> joannac: Right, I know. Locally, I don't have a system.users because I don't have any db users
[03:35:09] <joannac> okay
[03:35:19] <the8thbit> remotely I have db users, but I don't have the users db that I'm using to manage users... which is why I think I'm getting that error when I try to log in
[03:35:28] <the8thbit> *users collection
[03:35:45] <joannac> I don't understand that statement
[03:35:49] <the8thbit> hmm
[03:35:52] <the8thbit> its confusing
[03:35:55] <the8thbit> so
[03:35:58] <joannac> if you have mongodb users, you have a system.users collection
[03:36:02] <the8thbit> right
[03:36:08] <joannac> I don't care about your application's users
[03:36:12] <the8thbit> and I also have users of my app
[03:36:32] <the8thbit> but I think the reason I'm getting an error is because the app users collection doesn't exist
[03:36:38] <joannac> okay
[03:36:49] <joannac> well i can't help you with your app... that's on you :p
[03:37:09] <the8thbit> joannac: Well, I'm confused because I have it locally, its just not showing up remotely
[03:37:20] <the8thbit> joannac: you mind if I pastebin my schema code?
[03:37:56] <the8thbit> http://pastebin.com/feDwpght
[03:38:59] <the8thbit> that's required by this:
[03:38:59] <the8thbit> http://pastebin.com/GgVavNux
[03:39:09] <the8thbit> which in turn is required in my node.js server file
[03:39:28] <the8thbit> shouldn't it create the collection when the node.js server is started?
[03:40:13] <joannac> Not something I'm familiar with, sorry
[03:40:19] <joannac> Maybe someone else can help
[03:40:25] <the8thbit> ok, thanks anyway
[05:40:40] <brucelee> for mongodb + ssl, can we simply compile the source to install it, and then the just save the produced folder to subsequent servers
[05:41:01] <brucelee> or do we have to compile it over again for the next mongodb installation?
[06:41:35] <scruz> hello. been trying to do this https://dpaste.de/o6dw with the aggregation framework. any help, please?
[07:18:53] <kali> scruz: it's not possible
[07:20:56] <scruz> kali: just found http://www.kamsky.org/1/post/2013/04/using-aggregation-framework-to-reshape-schema.html
[07:28:39] <kali> yes, indeed, but you need to know all the possible keys beforehand
[11:06:24] <danpalmer> I'm doing a research project at uni, analysing MongoDB in terms of distributed systems, I was wondering if some people here could give me some input.
[11:07:30] <danpalmer> I'm trying to figure out Replica Sets and leader elections stuff. There doesn't seem to be an algorithm like Paxos/Raft/etc behind it, and I can't get much detail on how things like partial network failures and latency are handled.
[11:08:46] <danpalmer> Is it the desire for the sort of 'tunable' consistency in MongoDB that decided that? Those consensus algorithms are typically used for distributed transactions.
[12:18:44] <GHJGH> afternoon all, how do you go about naming your mongo servers? ive come up with - {env}-{service}-mdb-{replica-set}-s{#shard}-{#server}, is there a better way?
[12:21:18] <kees_> i gave them names from greek mythology and remember what it does, but if you want to use those names, don't user abbr too much
[12:30:45] <GHJGH> greeks cool, but i need something a little more 'webscale'
[13:22:03] <NoReflex> hello! Can i recreate a binary object from the it's string representation?
[13:23:03] <NoReflex> I only have a "paste" of the actual binary data from a logfile; I cannot access the mongodb instance where the actual binary data is stored
[15:23:24] <obihann> morning
[15:25:08] <obihann> I know this isn't the mongoose channel but their channel is dead
[15:25:12] <obihann> with the following model, how would I perform a find a populate on the members.user object? https://gist.github.com/anonymous/9413322
[15:25:44] <obihann> sorry wrong gist https://gist.github.com/anonymous/9413415
[15:55:38] <Veejay> Is there a command that allows one to retrieve the URL of the primary node in a replica set?
[16:02:38] <GHJGH> rs.status()
[16:05:19] <GHJGH> or rs.isMaster()
[16:43:35] <freeMind> Hi every body, im using mongoDB with c++ driver i want to get list of filed names of each document in my collection if u can help me
[17:03:39] <codydh> Hello! Silly question, but if I apt-get install mongodb on Ubuntu, how do I figure out the necessary user/pass to connect using a local Node.JS app?
[17:25:20] <chandru_in> If the page of index to be updated is not in memory, will mongod yield the lock while fetching the page?
[17:25:52] <nukulb> joannac: quick question for you when you get a minute. on the text search docs - http://docs.mongodb.org/manual/tutorial/enable-text-search/ it say its Beta feature and don't enable it on Production. What are the consequences of using this in Production?
[18:31:20] <joannac> nukulb: the same as any other beta feature? it may not work, it may have bugs, it may have effects you don't expect, the implementation details (e.g. API) might change
[18:32:43] <nukulb> joannac: is there a timeline for something like this to come out of Beta and become a full feature? doesn't have to be accurate just looking at it so I can plan better to switch over to this
[18:36:03] <nukulb> joannac: more importantly I am looking for a way to do a weight search other than using a full text search. So basically be able to do a search using $regex with different properties get different weights and then sort by that . Do you know of any examples?
[18:38:43] <tscanausa> do replicate sets allow for ip addresses for naming members?
[18:48:41] <joannac> tscanausa: yes
[19:34:48] <avelino> hi guys, 'm working in open source BI application, per default used riak, the monongodb team want to sponsor to implementation mongodb alternative data base?
[19:35:17] <avelino> souce: https://github.com/avelino/mining
[19:45:48] <tscanausa> joannac: how?
[19:46:16] <joannac> tscanausa: what do you mean?
[19:46:29] <joannac> rs.add("ip.add.ress.here:port")
[19:46:50] <tscanausa> everytime I try to use ip addresses as replica set configs it says cant find self in initialize
[19:47:11] <joannac> do the servers know what their IP addresses are?
[19:47:43] <tscanausa> they know their own ip address
[19:50:44] <joannac> okay, on one of your secondaries, pastebin: rs.conf(), rs.status(), a log snippet, and mongo --host ipaddress --port port
[19:55:28] <tscanausa> joannac: ok give me a few to get it all organized
[20:08:37] <tscanausa> joannac: even with fdqn the nodes wont "find" them selves.
[20:09:41] <cheeser> aren't we *all* trying to find ourselves? need we be so hard on those nodes?
[20:10:33] <joannac> tscanausa: i have seen this work, so I really need more information to figure out why it's not working for you
[20:20:04] <tscanausa> joannac: here is what I am currently seeing https://gist.github.com/anonymous/9419116
[20:24:26] <saml> is mongorestore supposed to be slow ?
[20:25:04] <saml> i think it's very io intensive
[20:26:10] <cheeser> slow *was* a design goal, i'm sure.
[20:28:48] <joannac> tscanausa: you're missing the port
[20:29:02] <saml> really? i like a fast restore/import
[20:29:18] <saml> i got a recruiter from mongodb
[20:29:24] <saml> email from
[20:29:40] <saml> should i get an interview and make mongodb better?
[20:29:51] <tscanausa> joannac: looks like cssh was messing with mongo shell
[20:30:38] <joannac> tscanausa: also, you're on a very old version of mongodb which means you may be hitting a bug I'm not familiar with
[20:33:00] <tscanausa> I just noticed the old version, Ill change that
[20:33:11] <mboman> I was thinking of plotting some values from my mongodb collection, what would be the best way to do this? Own python program, or has something already been created?
[20:33:25] <joannac> tscanausa: also, `mongo --host testmongod-02-ord.example.com
[20:33:28] <joannac> oops
[20:33:34] <joannac> tscanausa: also, `mongo --host testmongod-02-ord.example.com --port 27017`
[20:33:42] <joannac> just to make sure it can find itself
[20:33:46] <mboman> (I am going fishing with the data I got stored in Mongodb for patterns)
[20:34:21] <tscanausa> joannac: is the host option does not seem available in the config docs
[20:39:37] <joannac> ongo --host localhost --port 27017
[20:39:37] <joannac> MongoDB shell version: 2.0.4
[20:39:37] <joannac> connecting to: localhost:27017/test
[20:39:38] <joannac> >
[20:39:46] <joannac> I gtg, good luck
[20:40:20] <tscanausa> thanks its working now
[20:42:28] <joannac> how did you fix it?
[21:54:34] <harttho> Say you want to store X documents a day (where X > 10mm and is distributed over the day), the order of the documents doesn't matter, but querying them on time_entered (separate than _id) is important
[21:54:58] <harttho> There will also be a few indexes on other fields in the document
[21:55:17] <harttho> How do you keep the indexes getting so large they stop being nearly as useful?
[21:56:43] <harttho> Originally we had a separate collections by day, but querying can get annoying having them separated
[22:12:33] <synth_> hello, i'm curious what the best method for checking if a record in a collection contains an attribute?
[22:12:55] <cheeser> $exists
[22:14:21] <synth_> okay, so in python, i tried doing this, however i'm not sure if i was doing it correctly.... here's my code: self._user_collection.find({"uid":uid}, {attr:{"$exists":True}}); where "attr" is an attribute like "phone"... using that code, i was still able to return a cursor even though the attr didn't exist
[22:15:11] <cheeser> was there anything in the cursor?
[22:16:18] <synth_> see, that's where i was a bit confused. i thought it would return None
[22:16:41] <synth_> (i'm new at this)
[22:16:43] <cheeser> in java, you'd get back a cursor with no elements
[22:22:13] <synth_> ahh i see what i was doing wrong.
[22:22:16] <synth_> thank you!
[22:28:08] <cheeser> np
[22:32:59] <iksik_> hello, it's my first time with mongorestore https://gist.github.com/krzysztofantczak/6e8b07223abee3743356 - but there is one weird thing, api collection is empty after restore, any ideas why?
[22:34:35] <cheeser> what's with that "db" option there?
[22:35:13] <iksik_> it's a directory name
[22:35:44] <iksik_> database name actually, this directory was created during mongodump
[22:36:17] <cheeser> ah
[22:37:00] <iksik_> i was also trying to copy this one collection using robomongo tool with exactly same result, all collections are fine but 'api' is empty :|
[22:37:33] <iksik_> no idea how to debug etc.
[22:38:47] <iksik_> example document from 'api' collection looks like this https://gist.github.com/krzysztofantczak/9814af36141d1cb2812f - if it matters
[22:39:46] <cheeser> connect to mongo with no params, then "show dbs"
[22:41:29] <iksik_> cheeser to my target database? where i'm trying to restore that collection?
[22:41:54] <cheeser> yes
[22:42:08] <iksik_> apify 0.203125GB
[22:42:48] <synth_> any idea why i'm getting this error? self._user_collection.find({"uid":user_id}, {"phone":{"$exists": False}}) produces: pymongo.errors.OperationFailure: database error: Unsupported projection option: $exists
[22:43:23] <cheeser> self._user_collection.find({"uid":user_id, "phone":{"$exists": False}})
[22:43:30] <synth_> ahhh okay
[22:43:32] <synth_> thank you
[22:43:46] <cheeser> that second document is for the fields to return from the documents the query matches
[22:44:31] <iksik_> hm