PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 15th of January, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:17:10] <johnjohn101> hi peeps
[00:22:40] <daidoji> hello #mongodb
[00:22:40] <daidoji> I see dropDups being deprecated in some documentation for various libraries
[00:22:40] <daidoji> but I can't seem to find confirmation on teh actual site
[00:23:19] <daidoji> hello #mongodb
[00:23:23] <daidoji> I see dropDups being deprecated in some documentation for various libraries
[00:23:27] <daidoji> but I can't seem to find confirmation on teh actual site
[00:23:33] <daidoji> would anyone be able to help me out?
[00:28:49] <Boomtime> daidoji: can you provide an example of where you see dropDups being deprecated?
[00:29:53] <Boomtime> apparently he can't...
[00:30:19] <Boomtime> daidoji: did you see my message?
[00:34:54] <daidoji> Boomtime: I did, thanks
[02:58:06] <Artificial> Hey, I have a question. Sort of messy to type in IRC, so threw it in a gist.
[02:58:07] <Artificial> https://gist.github.com/alexberriman/7d21ef40e854d8b7767d
[02:58:11] <Artificial> Is anybody able to help?
[03:01:39] <acidjazz> hi everyone.. any1 know of a php blog platofrm that uses mongo?
[03:01:54] <acidjazz> ive been given a project and all the popular platforms ive found are all mysql
[03:05:05] <joannac> Artificial: so for each field, it either has the same value as the sample document, or the field doesn't exist, right
[03:05:27] <Artificial> Its value has to exist within the supplied document
[03:05:51] <Artificial> So a document where the condition is: "condition":{"formId":"7",
[03:05:51] <Artificial> },
[03:06:03] <Artificial> Would be returned, because that exists WITHIN the document I supplied
[03:06:27] <joannac> what about a document that has no conditions subdocument?
[03:06:54] <Artificial> Then yes, it would also be returned.
[03:06:54] <joannac> or a document with an empty conditions subdocument?
[03:07:08] <Artificial> Basically im just looking for a complete or partial match within the supplied document
[03:07:50] <Artificial> There will always be a condition, but hypothetically, I suppose it should return when the condition is empty.
[03:07:59] <joannac> right
[03:08:30] <Artificial> Basically I'm looking for an intersection with a supplied document.
[03:09:36] <joannac> so $or: [ {"condition.foo": value}, {"condition.foo": {$exists:false}}]
[03:09:49] <joannac> and then you want a $and over many of these $or clauses, one per field
[03:10:42] <Artificial> So essentially the only way to do it is one big query?
[03:10:47] <Artificial> Generated programmatically?
[03:11:16] <joannac> yes? there's no "subset" command
[03:12:10] <lqez> acidjazz: refer http://docs.mongodb.org/ecosystem/tools/applications/
[03:12:32] <lqez> and https://github.com/WebTales/rubedo ?
[03:12:45] <lqez> I'm not an expert on php and mongodb - I just googled.
[03:13:34] <acidjazz> thanks.. no blogs listed
[03:13:51] <acidjazz> ah CMS
[03:13:52] <acidjazz> oof zend
[03:13:58] <joannac> Artificial: if that sounds painful (and it does), you should consider a different schema
[03:14:58] <Artificial> Yes, it does sound painful. A new schema may be required, I just need to brainstorm one that suits requirements.
[03:15:02] <Artificial> Thank you
[03:15:42] <lqez> acidjazz: yeah, I googled with php + mongodb + blog, but no suitable result returned. :X
[03:15:48] <Artificial> I'm looking at $setIntersection, may have a bit of a play around with it.
[03:16:03] <Artificial> @lqez, isn't there a website out there that tries to market itself like Wordpress but with mongo?
[03:16:26] <lqez> Artificial: with php?
[03:16:43] <Artificial> http://www.mongopress.org/
[03:16:48] <Artificial> I don't know how good it is. Could be rubbish.
[03:17:20] <lqez> mongopress !
[03:18:13] <lqez> there is also another mongopress (in nodejs) https://github.com/marizmelo/MongoPress
[03:18:14] <cheeser> well, as awesome as mongo is, wordpress comes with a ton of baggage unrelated to the db...
[03:19:09] <Artificial> Wordpress is also disgustingly horrible. I'd stay clear unless you want a 30 second set up.
[03:19:28] <cheeser> you should use squarespace :D
[03:20:03] <lqez> hhh
[03:20:53] <Artificial> joannac, $setIsSubset could be what I'm after, if I were to use an array instead of a nested document
[03:22:18] <joannac> that also requires aggregation :)
[03:25:54] <Artificial> Aggregation no bueno?
[03:26:02] <cheeser> es muy bueno!
[03:26:35] <lqez> Artificial: https://gist.github.com/alexberriman/7d21ef40e854d8b7767d#file-gistfile1-txt-L64-L67
[03:27:19] <lqez> these lines mean formId='7' or fieldId='54ac9c1ba40049c40e8b4567' or oldValue='oldValue03' or newValue='newValue04' ?
[03:28:12] <joannac> lqez: no, because formId=7 and fieldId = 'test' should not match
[03:28:16] <joannac> but it does in your query
[03:28:26] <lqez> gotcha
[03:28:35] <joannac> (at least, that's how I understood it)
[03:28:44] <Artificial> joannac is correct
[03:28:54] <Artificial> I seem to be able to perform operations on arrays but not nested documents
[03:29:01] <Artificial> So if I just convert it to arrays with values like...
[03:29:20] <lqez> It means "if key exists, it must be same" right?
[03:29:31] <Artificial> ["formId.7","fieldId.blah","newValue.hello"]
[03:29:45] <Artificial> I can probably perform array operations on it instead
[03:29:48] <lqez> it looks like it needs unwind ...
[03:30:05] <Artificial> Which from reading is fairly inefficient
[03:30:29] <lqez> too difficult for me :X
[03:31:53] <Artificial> I'm pretty sure I can just convert it to an array and just use $all
[03:32:34] <joannac> Artificial: ?
[03:32:48] <joannac> if you have a document with just dataId:7
[03:33:15] <joannac> and your query is $all: [dataId:7, fieldId:"abc"]
[03:33:28] <joannac> it will not match
[03:33:48] <Artificial> No I would convert it to an array whos value is literally "dataId.7","fieldId.abc"
[03:33:58] <Artificial> An array whos values are: key.value
[03:34:44] <joannac> okay, if you have a document with conditions: ['dataid:7']
[03:35:12] <joannac> and a query of conditions: {$all: ['dataid:7', 'newValue:hello']}
[03:35:17] <joannac> it will not match?
[03:37:50] <Artificial> I think I can do it pretty easily, let me just see.
[03:40:58] <Artificial> Nvm I was wrong, lol.
[03:45:02] <Artificial> This is much easier in elastic search, lol
[03:48:26] <cheeser> oh, hi scottbessler :) https://github.com/mongodb/morphia/pull/696
[03:49:34] <joannac> hi cheeser :p
[03:50:02] <cheeser> 'sup, joannac ?
[03:50:03] <cheeser> :D
[03:50:45] <joannac> hi Boomtime!
[03:50:59] <scottbessler> cheeser, hi :)
[03:51:02] <Boomtime> hi joannac!
[03:51:15] <cheeser> scottbessler: i'm evanchooly :)
[03:51:25] <scottbessler> nice to irc-meet you hehe
[04:10:28] <Artificial> @joannac, can just convert to an array and use something like this:
[04:10:30] <Artificial> db.test2.find({condition: { $not: {$elemMatch: {$nin: ["a", "b", "c", "d", "e"]}}})
[04:10:33] <Artificial> Thanks for your help
[08:43:02] <devians> hi, can anyone help me with the user model in mongo?
[08:43:42] <devians> I've made a user admin and a root account like the docs say, and I've made my application user and given them a role over the application db, but I can't login against the application db because it doesn't exist yet (as far as I can tell?)
[09:47:44] <sjose_> Hi, how to query an embedded document using its id..?
[09:48:29] <kali> sjose_: use the . notation
[09:51:08] <sjose_> kali: I'm generating ObjectId for embedded document using _id = ObjectId, but I'm not able to fetch even using '.' respective item using id Eg: ObjectId("54b761dcba090148f2139c9b")
[09:51:51] <kali> sjose_: show us a typical document and what you've come out so far as a query
[09:52:17] <sjose_> kali, This is the query : db.training_partner.find({'trainings._id':ObjectId("54b761dcba090148f2139c9b")})
[09:52:26] <sjose_> kali, its not working
[09:52:41] <sjose_> there is an item with that Id
[09:52:48] <kali> sjose_: show us the document
[09:52:55] <kali> sjose_: it should be working.
[10:01:57] <sjose_> kali, {u'phone_number': u'9964122kkjk', u'password': u'1', u'confirmpwd': u'1', u'trainings': [{u'programme_name': u'abdddc', u'_id': ObjectId('54b761dcba090148f2139c9b')}, {u'programme_name': u'bcde', u'_id': ObjectId('54b761dcba090148f2139c9c')}, {u'programme_name': u'abdddc', u'_id': ObjectId('54b76aaaba090154e459d564')}, {u'programme_name': u'bcde', u'_id': ObjectId('54b76aaaba090154e459d565')}], u'partner_name': u'QSpider', u'location': u'kjdksd', u'
[10:01:58] <sjose_> mobile_number': u'5555', u'contact_person': u'Rauiyi', u'_id': ObjectId('54b39339ba0901263ae861ad'), u'email': u'a@g.com'}
[10:02:48] <kali> ok, next time, use a paste service
[10:03:08] <sjose_> kali, I don't know how to use that...
[10:03:37] <kali> you put your stuff there http://pastebin.com/, they give you an url, you paste the url here
[10:04:00] <sjose_> kali, ...thanks
[10:04:04] <kali> try your query in the mongo shell, it should work.
[10:06:02] <sjose_> kali, see this.. http://pastebin.com/BSy6rP84
[10:06:26] <sjose_> I'don't know what is wrong here..
[10:06:29] <kali> try the query in the shell
[10:07:29] <sjose_> I'm using robomongo UI tool, if change training._id to trainings._programe_name it will work
[10:08:05] <sjose_> kali, is there anything wrong with generating objectId
[10:08:41] <kali> nope. please try in the shell
[10:08:47] <sjose_> ok
[10:10:47] <sjose_> kali, really sorry I'queried with out updating the document...
[10:11:17] <kali> :)
[10:13:00] <sjose_> kali, if I want to fetch a specific embedded document ..? then can I filter it..?
[10:14:24] <kali> sjose_: http://docs.mongodb.org/manual/reference/operator/projection/elemMatch/
[10:15:27] <sjose_> kali, I want to fetch using subdocument Id...
[10:15:50] <kali> use $elemMatch in the projection clause
[10:17:52] <sjose_> kali, like this ...db.training_partner.findOne({'trainings._id':ObjectId("54b761dcba090148f2139c9c")},{$elemMatch:{_id:ObjectId("54b761dcba090148f2139c9c")}})
[10:18:34] <kali> you need a a { trainings : { .... } } around your $elemMatch. look at the doc
[10:18:34] <sjose_> but it throws error..
[10:18:52] <sjose_> ok let me see
[10:25:40] <sjose_> kali, It worked perfectly .....Thanks Very Much!!!
[11:07:22] <edgar> Hi all, my .find and .count return incompatible results with the nodejs driver (only with version 2.0), any ideas ? Here is the link to the question I asked on stackoverflow : http://stackoverflow.com/questions/27961938/mongodb-2-0-nodejs-driver-find-and-count-return-incompatible-results
[12:42:46] <Infin1ty> I am running version 2.2 at the moment, i'm trying to find out what is the reason for creating local oplog on the config servers on 2.6?
[14:23:46] <dfinn> I'm trying to enable directoryPerDB but getting an error that it doesn't recognize that entry in the config file, anyone know what I'm missig here?
[14:23:49] <dfinn> http://paste.ubuntu.com/9756026/
[14:27:05] <dfinn> using the flag --directoryperdb to start mongo manually worked but for whatever reason it doesn't like it in the config file
[14:28:31] <kiko_> I can't get past this exception com.google.code.morphia.mapping.MappingException: Error mapping field:
[14:28:38] <kiko_> it's for a map inside a class in java
[14:37:03] <cheeser> kiko_: there's half a dozen newer versions since that...
[14:43:44] <kiko_> cheeser: of morphia?
[14:48:08] <kiko_> basically what I want is an object that is to be persisted but inside it has a map like this Map<String, MyClass> map1 = new HashMap<String, MyClass>
[14:54:08] <mwhooker> Hi all, wondering if anyone can help me convert a sql statement to 2.4 mongodbese https://gist.github.com/mwhooker/c601ff70d20e303a3e8f
[14:55:21] <kali> it's non trivial
[14:55:44] <kiko_> mwhooker: you can try this http://www.querymongo.com/
[14:55:53] <mwhooker> it doesn't work for updates or joins
[14:56:00] <mwhooker> but thanks kiko_
[14:57:14] <cheeser> kiko_: yes. that version is probably 2 years out of date
[14:58:01] <kiko_> cheeser: is there an example of an object that has inside a map whose value is a class I create?
[15:00:31] <cheeser> kiko_: you should update to the latest morphia and see if the problem exists.
[15:00:43] <cheeser> https://github.com/mongodb/morphia
[15:00:45] <kiko_> this?
[15:00:46] <kiko_> http://mvnrepository.com/artifact/org.mongodb.morphia/morphia/0.109
[15:01:22] <cheeser> yeah
[15:03:38] <rlepine> sd
[15:03:59] <kiko_> problem is they changed all the packages
[15:04:03] <kiko_> it's a mess to do that
[15:05:29] <spuz> I'm having trouble writing a query. I need to find all documents where the fields "x" and "x.y" exist and are not empty. x and y are both arrays. I've tried every combination of explicit and implicit ands that I can think of but am not getting the right results. Any ideas where I can get more info?
[15:05:31] <cheeser> a simple global search and replace, though
[15:06:16] <Bico_Fino> Hello, I'm trying create a user and getting this message 2015-01-15T13:03:18.912-0200 Error: couldn't add user: not master at src/mongo/shell/db.js:1004
[15:06:29] <Bico_Fino> I'm using this doc http://docs.mongodb.org/manual/tutorial/deploy-replica-set-with-auth/
[15:08:20] <Bico_Fino> forgot to run rs.initiate()
[15:25:16] <spuz> is it possible to search mongodb documents for a value without knowing the field name?
[15:27:31] <cheeser> not afaik
[15:27:57] <mwhooker> hi all, want to ask once more for help converting this sql query to mongodb. I'm not sure it's possible, but hope to shed some light https://gist.github.com/mwhooker/c601ff70d20e303a3e8f
[15:39:56] <gregf_> hi
[15:40:09] <gregf_> i'm on ubuntu 12.04, mongo client - 2.0.4. i needed to upgrade to the latest mongo client
[15:40:30] <FunnyLookinHat> If I'm using a collection to gather a bunch of data points to run reports at a later date, is the general strategy to index any field you would want to report on - OR - to iterate sets based on a more broad index field?
[15:42:30] <cheeser> you index fields you want to query against.
[15:42:51] <cheeser> just because it shows up in a report doesn't mean you need to index it.
[15:43:54] <FunnyLookinHat> cheeser, is there a way to determine how large an index is ?
[15:44:48] <cheeser> http://docs.mongodb.org/manual/faq/indexes/#how-do-you-determine-the-size-of-an-index
[15:46:02] <FunnyLookinHat> cheeser, thanks!
[15:46:33] <cheeser> np
[15:48:16] <FunnyLookinHat> Last question - any idea why this index ( beam.identifier ) might not be working? http://pastebin.ubuntu.com/9756387/
[15:48:28] <FunnyLookinHat> I created it the same way as beam.id and that one seems to work fine
[15:49:09] <StephenLynx> what is your conception of "working" in this case?
[15:49:17] <kali> identifIer
[15:49:20] <kali> you forgot the I
[15:49:39] <kali> the index has nothing to do with it in the first place
[15:50:00] <StephenLynx> oh, yeah, there is a typo in the query
[15:51:32] <FunnyLookinHat> omg.
[15:51:56] <FunnyLookinHat> I tried deleting and re-adding the index two times... all because of that. ha.
[15:52:17] <StephenLynx> :v
[15:52:31] <StephenLynx> already happened to me. the thing was fine itself, but the test was wrong.
[15:53:01] <FunnyLookinHat> :D
[16:06:18] <saml> https://gist.github.com/saml/41ea75c6a0bacb73f9a7 why is this so slow when it is hitting index?
[16:06:57] <kali> how slow is it ?
[16:07:07] <StephenLynx> what does the explain does?
[16:07:33] <StephenLynx> what is the index?
[16:13:34] <saml> it has noticible 2-3 second delay until it prints out kali
[16:13:38] <saml> but now it's fast again
[16:13:44] <saml> maybe temporary hiccup
[16:31:40] <Raffaele> Hello. Some time ago I did cross-compile mongodb for a MIPS platform but I had to make more than a couple of changes in both the code and the build scripts
[16:32:02] <Raffaele> Now I'd like to contribute these changes back to the community. What's the actual process for that ?
[16:32:50] <StephenLynx> http://www.mongodb.org/about/contributors/
[16:33:25] <cheeser> https://github.com/mongodb/mongo/blob/master/CONTRIBUTING.rst
[16:34:55] <Raffaele> So i understand I'd need to create a SERVER Jira ticket. Would I be allow to do that or do I need some sort of permission granted from someone ?
[16:41:39] <cheeser> you should be able to create one.
[16:41:42] <kali> just create an account
[17:46:03] <Bico_Fino> Hello, there is a way to create a mongo database without authentication?
[17:46:26] <StephenLynx> yes.
[17:46:31] <StephenLynx> it is done like that by default.
[17:46:57] <Bico_Fino> But I have configured authentication.
[17:47:18] <StephenLynx> so undo it.
[17:52:24] <Torkable> lol
[20:00:37] <blizzow> I'm trying to do a mongodump with a query based off a field called date that I have in my records (format YYYYMMDD). so I do: mongodump -h myrouter -u myuser -p mypasswd -d mydb -c mycollection -q '{date: { $gt: ("20140704") } } '
[20:00:41] <blizzow> it fails and I get: "assertion: 16619 code FailedToParse: FailedToParse: Bad characters in value: offset:13" What's wrong with my query field?
[20:01:16] <harttho> why the ( ) around "20140704?"
[20:01:19] <kali> blizzow: ditch the ()
[20:04:19] <cheeser> /6
[20:05:59] <blizzow> kali, and harttho. thanks! That worked. I had previously done dumps with a query like this: -q {_id: { $gt: ObjectId("54188da10000000000000000") } }
[20:05:59] <blizzow> I guess I'm not understanding why the () would work with the objectID but not date.
[20:16:17] <harttho> A date object would look like ISODate("2014-02-10T10:50:42.389Z")
[20:16:23] <harttho> The way you're saving it, it's just a string
[20:17:21] <harttho> also new Date(millis) will create an ISODate object in there too
[20:17:48] <harttho> Both will have useful functions associated, where your string you're currently storing is just a string
[22:07:13] <Torqable> is there a good way to validate a schema
[22:07:19] <Torqable> without mongoose
[22:07:56] <Torqable> using node.js
[22:08:47] <harttho> thoughtful design and implementation
[22:09:01] <Torqable> wut
[22:09:07] <harttho> I typically error on the side of not using mongoose-esque libraries
[22:09:36] <harttho> Basically write my own validation, seems to pan out in the long run
[22:10:12] <Torqable> so you validate the json on the server before the query
[22:10:44] <harttho> yes, where applicable
[22:11:01] <Torqable> was thinking I could validate using the jsonschema lib, but it doesn't look like I can enforce field length with that
[22:11:04] <harttho> Ideally in a centralized place that allows easy versioning
[22:11:09] <Torqable> like 200 characters for example
[22:12:23] <harttho> Depending on how comfortable you are with json, you can create a rich document that contains the info like that
[22:12:33] <harttho> As you need stricter validation, just add it on there
[22:43:04] <daidoji> hello #mongodb, I know I'm cross-asking but does anyone know why MongoEngine validation for ReferenceField requires that it be an ObjectId to save()?
[22:51:50] <daidoji> actually it seems related maybe to https://github.com/MongoEngine/mongoengine/issues/541