PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 22nd of September, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[03:25:44] <csalvato> hi all
[03:27:22] <Boomtime> hi there
[03:32:15] <csalvato> anyone from compose.io hang here?
[03:35:29] <cheeser> not that i know of
[03:44:54] <csalvato> Oh, I forgot - I have a question. If one wanted to learn MongoDB from the ground up, what do you guys think is the #1 best way to do that? Best book/tutorial, for example?
[03:54:08] <csalvato> anyone? :)
[03:56:52] <Boomtime> csalvato: https://university.mongodb.com/courses/M101P/about
[03:57:37] <csalvato> awesome — free, too
[03:57:42] <Boomtime> yepperino
[03:58:48] <Boomtime> it's surprisingly good, watch videos, do stuff with the db, run it locally, and take little quizzes from time to time
[03:59:19] <Boomtime> there are also some courses for specific languages if you'd prefer to learn it via C#, Java etc
[04:01:39] <csalvato> languages I am good on
[04:01:42] <csalvato> my Database skills are lacking
[04:02:17] <csalvato> I wanna learn MongoDB, ElasticSearch, RethinkDB, Redis and PostgreSQL end to end
[04:02:23] <csalvato> but Mongo is most interesting so...
[04:08:51] <csalvato> Boomtime: thanks a lot
[04:15:09] <nofxx> csalvato, hehe you named every DB we use. Only we're not using so much anymore is PG, and rething starting a project concept
[04:15:26] <nofxx> Ah, only one missing... couchdb, and pouchdb too
[04:15:29] <csalvato> nofxx: who is we? :)
[04:15:36] <nofxx> our small startup ;)
[04:16:28] <nofxx> usually all stuff is on mongo, redis is used a lot, background jobs to queues and caches and whatnot
[04:16:46] <nofxx> ES.. well... full text,.... How I wish there was a non-java alternative.. but anyways
[04:17:09] <nofxx> and PG when we need transaction... MONEY
[04:17:34] <nofxx> btw, percona looks like is giving some love now to tokumx
[04:17:52] <nofxx> let's see if we'll get to fractals and transactions on mongo someday
[04:18:57] <nofxx> guess they were waiting for the new engine thing settles? Plugin same as wiretiger I believe.
[05:56:00] <nerd> hello guys :) i am new to DB thing, just starting up, so should i start with learning mondodb or mysql ?
[05:56:35] <Boomtime> you've joined #mongodb so haven't you already made that choice?
[05:56:56] <Boomtime> would you like resources on how to learn mongodb?
[05:57:04] <nerd> Boomtime: sure :)
[05:57:08] <Boomtime> if you want to learn mysql, this is not the channel you are looking for
[05:57:25] <nerd> i just thought that learning mysql might be helpful to learn mongodb :)
[05:57:25] <Boomtime> mongodb online training: https://university.mongodb.com/courses/M101P/about
[05:57:33] <Boomtime> definitely not
[05:57:54] <nerd> i am learning meteora, not interested in mysql..
[05:58:06] <nerd> so i am good to go with just mongodb :)
[05:58:31] <Boomtime> excellent, then this is the right channel
[05:58:48] <nerd> Boomtime: are thre previous recording of this course available ?
[06:01:05] <Boomtime> not sure about that - but the next course starts in like 2 weeks or something..
[06:01:27] <nerd> i am quite impatient to wait 2 weeks, in a mood to start learning straight away :)
[06:01:50] <joannac> Sorry, the courses are run on a timeline
[06:02:07] <nerd> joannac: are the recording of previous course available ?
[06:02:13] <joannac> They are available on=demand with a subscription
[06:02:18] <joannac> Otherwise you'll need to wait
[06:02:46] <joannac> you could always work your way through the docs in the interim
[06:02:59] <nerd> joannac: ok :)
[06:07:09] <nerd> if i am about to buy a book which book you guys would recommend ?
[06:08:07] <Boomtime> http://shop.oreilly.com/product/0636920028031.do
[06:08:11] <nerd> how about getting this one http://www.amazon.com/MongoDB-Definitive-Guide-Kristina-Chodorow/dp/1449344682/ref=sr_1_1?s=books&ie=UTF8&qid=1442901733&sr=1-1&keywords=mongodb
[06:08:36] <nerd> Boomtime: i linked to the same book :)
[06:08:51] <nerd> so getting that book..
[06:08:57] <Boomtime> yeah, it's a good reference though it's getting to be a bit out of date
[06:09:09] <nerd> so should i get it or not ?
[06:09:23] <Boomtime> it will still give you an excellent introduction, and most things are still relevant
[06:09:43] <nerd> ok :)
[06:09:46] <Boomtime> it's merely that some things have gone beyond what the book covers, and some things a little different
[06:10:01] <Boomtime> nothing drastic, it's just starting to show it's age
[06:17:45] <nerd> Boomtime: orderd it :)
[06:18:30] <nerd> Boomtime: are there any pre-requisites ?
[07:55:09] <Zelest> so that's what the red button does...
[09:01:20] <m3t4lukas> hey, how do I get an array out of org.bson.Document?
[09:44:41] <auzty> i'm using mongodb 2.9 , how long string will be possible stored? i want store 1000 words
[09:45:00] <Derick> you should not use mongodb 2.9, it's not a stable release
[09:45:09] <Zelest> iirc, a document can be 16MB
[09:45:32] <auzty> sorry , i mean 2.6.9 Derick
[10:16:22] <es-kb09222015> hi
[10:17:02] <es-kb09222015> i am using mongodb with codeignitor and the select query is very slow
[10:17:14] <es-kb09222015> please help
[10:24:00] <es-kb09222015> <es-kb09222015> hi [15:43] <es-kb09222015> i am using mongodb with codeignitor and the select query is very slow [15:43] <es-kb09222015> please help
[10:25:21] <es-kb09222015> i am using mongodb with codeignitor and the select query is very slow please help
[10:27:37] <es-kb09222015> i am using mongodb with codeignitor and the select query is very slow tryed with limit and where please help
[13:11:35] <antiPoP> Hi, is this syntax correct for finding a subdoc? db.ads.find({type: {_id: '1'}}).pretty() ?
[13:13:53] <deathanchor> use $exists
[13:14:12] <deathanchor> find({ "type._id" : { $exists :1 } })
[13:16:19] <antiPoP> deathanchor, the issue is that i'm passing an object to node mongosee , and i was trying to pass the object directly to mongo
[13:17:25] <antiPoP> ok, thanks anyway
[13:19:54] <antiPoP> seems I have to use dot notation as passing an object searches for that exact object, right?
[13:22:52] <deathanchor> for mongo yes.
[13:23:28] <deathanchor> find({ "type._id" : { $exists :1 } }) would find doc: { type : { _id : { more : stuff } } }
[13:23:54] <deathanchor> also would find: { type : { _id : something } }
[13:29:01] <antiPoP> ok, thanks again
[13:29:55] <StephenLynx> I suggest you don't use mongoose antiPoP, the syntax it uses is different and confusing.
[13:30:02] <StephenLynx> plus it doesn't work right, period.
[13:30:45] <deathanchor> StephenLynx is the anti-mongoose advocate. I never used it. Choose your own evils :)
[13:31:00] <StephenLynx> I am not anti-mongoose, I am pro-quality.
[13:31:31] <antiPoP> StephenLynx, what do you suggest? in node is the most used ODM
[13:31:43] <StephenLynx> I suggest the native driver.
[13:32:19] <StephenLynx> great performance, great documentation, 10/10
[13:33:26] <antiPoP> thanks, I'll check it , although at this project is almost completed so I may keep mongosee....
[13:33:35] <StephenLynx> v:
[13:33:48] <StephenLynx> just keep in mind mongoose is a real performance hog
[13:33:53] <StephenLynx> about 6x slower.
[13:33:54] <antiPoP> no time for refactoring :(
[13:34:11] <StephenLynx> RIP
[13:34:31] <antiPoP> :P
[13:34:57] <antiPoP> btw shoudl I take any security when using mongo? I mean in mysql you need to escape parameters, etc...
[13:35:07] <antiPoP> or make prepared statements
[13:35:15] <StephenLynx> there is ONE thing you should keep in mind:
[13:35:29] <StephenLynx> to check if the parameters are not null or undefined.
[13:35:36] <StephenLynx> you see
[13:36:08] <antiPoP> well, in such case the wort i can have is an exception...
[13:36:16] <StephenLynx> oh no
[13:36:17] <StephenLynx> you won't
[13:36:24] <StephenLynx> if you query using {a:something.X} but something DOESNT have a property X, it will be {a:undefined}, which translates to {}
[13:36:43] <StephenLynx> and when you query using {} you are just asking for anything.
[13:37:14] <cheeser> if you query against a field that doesn't exist, the find won't return anything.
[13:37:30] <StephenLynx> except that in js
[13:37:35] <StephenLynx> it works like I described.
[13:37:54] <antiPoP> I see, thanks again :)
[13:38:21] <cheeser> oh, when the js engine is passing stuff off to mongo?
[13:38:32] <StephenLynx> no, just js.
[13:38:35] <deathanchor> got to compare some data from mysql to my mongodb data... so annoying.
[13:38:55] <StephenLynx> http://blog.websecurify.com/2014/08/hacking-nodejs-and-mongodb.html
[13:39:07] <StephenLynx> I actually made that mistake in my software once.
[13:39:36] <StephenLynx> because on my older ones I would validate the authentication tokens as any other mandatory parameters
[13:40:09] <StephenLynx> but in my last one I changed how I did things and that detail slipped, which allowed users using the json api to use the first account in the database freely
[13:41:02] <cheeser> StephenLynx: interesting. i hadn't thought of that attack vector but i do very little javascript.
[13:41:08] <cheeser> a good read. thanks for sharing.
[13:41:10] <StephenLynx> np
[13:41:29] <StephenLynx> good thing I caught that before anyone noticed on my deployed instance :v
[13:41:36] <StephenLynx> I found it by accident
[13:41:58] <cheeser> hehe
[13:42:05] <StephenLynx> like, I dropped the database while logged in the client
[13:42:29] <StephenLynx> and I noticed it allowed me keep using the system, which shouldn't be possible because the account hashed changed
[13:42:30] <Derick> why did you do that? :D
[13:42:36] <StephenLynx> why did I did what
[13:42:43] <Derick> dropped a database?
[13:42:52] <StephenLynx> because I wanted it to drop.
[13:42:54] <StephenLynx> :v
[13:42:59] <Derick> oh
[13:43:06] <StephenLynx> it was on development, I can't remember
[13:43:07] <Derick> I've done it by mistake before... hence me asking :)
[13:43:34] <StephenLynx> usually when I finish doing something messy I just drop the db and start it over.
[13:57:47] <m3t4lukas> is there any means of revision controlling parts of a database?
[13:58:14] <m3t4lukas> aaah, I'm dumb, just revctrl dumps + shell scripts
[13:59:00] <m3t4lukas> I like how you would be totally srewed when you try this using OracleDB
[13:59:44] <m3t4lukas> *screwed
[14:04:58] <m3t4lukas> cheeser: I use gradle with 'org.mongodb:mongodb-driver:3.0.2'. com.mongodb.client.MongoCollection<TDocument> seems to not implement findOne(). Is that correct?
[14:06:10] <m3t4lukas> Derick, GothAlice, joannac: also goes to you, I just saw that cheeser wrote something, so I thought it might be a good time to poke it in there
[14:10:47] <cheeser> m3t4lukas: collection.find().limit(1).first()
[14:11:22] <m3t4lukas> cheeser: this is what I do now. So it is by intension?
[14:11:28] <cheeser> yes
[14:11:29] <m3t4lukas> just wanted to mae sure
[14:11:32] <m3t4lukas> *make
[14:11:53] <m3t4lukas> in the docs there's still a findOne
[14:12:21] <m3t4lukas> http://docs.mongodb.org/master/reference/method/db.collection.findOne/
[14:12:50] <cheeser> that's the shell not the java driver
[14:13:09] <cheeser> http://mongodb.github.io/mongo-java-driver/
[14:13:16] <m3t4lukas> ah, okay, I thougt they pretty much all match
[14:14:05] <m3t4lukas> there's already a 3.0.4, seems like I'm missing out on action :P
[14:14:33] <cheeser> just bug fixes. 3.1.0-rc0 is out, though, if you're an upgrade junkie like myself.
[14:16:24] <m3t4lukas> I'll give it a shot :)
[14:16:55] <m3t4lukas> I'ts about time robomongo supports MongoDB 3
[14:17:38] <macabre> in mongo how would i find all 'sites' that match an 'id' ?
[14:18:22] <cheeser> macabre: http://docs.mongodb.org/manual/tutorial/query-documents/
[14:18:48] <m3t4lukas> just use a filter. The easiest one would be {'id': <yourValue>}
[14:20:49] <macabre> i guess i'm asking whats the equivilent to find * from sites where id = id?
[14:21:19] <cheeser> m3t4lukas just showed you
[14:22:09] <macabre> ah i missed that, cheeser, thanks
[14:23:52] <m3t4lukas> macabre: there will be courses starting next month on mongodb academy. Might be worth a shot ;)
[14:25:40] <cheeser> https://university.mongodb.com/
[14:26:55] <tubbo> oh man, i would totally love to see an advanced mongoid course
[15:17:15] <kedare> Hello o/
[15:17:44] <kedare> I have a little question, when I run sh.status(), I don't get a standard JSON output but a kind of humanized json with sections and title, how can I get pure json ?
[15:17:57] <kedare> Or it's just like this when calling the command from the mongo shell ?
[16:30:36] <deathanchor> kedare: https://docs.mongodb.org/manual/reference/method/db.printShardingStatus/#db.printShardingStatus
[16:31:06] <deathanchor> oh wait
[16:31:14] <deathanchor> you might just have to query the config server directly
[16:31:24] <deathanchor> if you want straight up json
[16:31:38] <deathanchor> you are safe to do finds there
[19:37:46] <lindenle> HI all. I created a sharded cluster using two replica sets as the shards. Now when i try to insert into a collection that I have sharded it gives me an error about: "no progress was made executing batch write op in test_db.test_collection after 5 rounds". What did I miss?
[19:56:59] <steeze> hey all, trying to do a text search with a phrase that is being programmatically passed in. i tried building a string with the req to match mongodb's documentation but it doesnt seem to be working
[19:58:08] <steeze> here's a small snippet to show you what i tried http://pastebin.com/3BPGBEQv
[19:59:50] <StephenLynx> you are trying to return the value on an asynchronous function
[20:00:06] <StephenLynx> exports.returnSearchJson will ALWAYS return null
[20:00:50] <StephenLynx> this function will have to take its own callback as one of the parameters and execute this callback inside the toArray's callback passing the array of values.
[20:01:40] <StephenLynx> or even better, pass the callback received by it directly to toArray
[20:02:13] <StephenLynx> http://pastebin.com/0XnJAPZR
[20:11:13] <steeze> i was experiencing some network issues so not sure if this went through but:
[20:11:17] <steeze> hey all, trying to do a text search with a phrase that is being programmatically passed in. i tried building a string with the req to match mongodb's documentation but it doesnt seem to be working
[20:11:23] <steeze> here's a small snippet to show you what i tried http://pastebin.com/3BPGBEQv
[20:12:05] <StephenLynx> StephenLynx> you are trying to return the value on an asynchronous function
[20:12:06] <StephenLynx> <StephenLynx> exports.returnSearchJson will ALWAYS return null
[20:12:06] <StephenLynx> <StephenLynx> this function will have to take its own callback as one of the parameters and execute this callback inside the toArray's callback passing the array of values.
[20:12:06] <StephenLynx> <StephenLynx> or even better, pass the callback received by it directly to toArray
[20:12:06] <StephenLynx> <StephenLynx> http://pastebin.com/0XnJAPZR
[20:12:39] <steeze> that's not true. it will return properly if it matches the whole string
[20:12:57] <steeze> that is just the function that is the callback for my api endpoint
[20:13:03] <StephenLynx> give me the full code of the functions
[20:13:26] <StephenLynx> of the function*
[20:13:46] <StephenLynx> it might be falling back to promises
[20:13:51] <StephenLynx> but I wouldn't use it.
[20:13:59] <StephenLynx> the promises, it is.
[20:14:21] <steeze> well, everything is working properly, it jsut doesnt match substrings in text search
[20:14:35] <steeze> it matches
[20:14:41] <steeze> 'state' with state but not 'sta'
[20:15:40] <steeze> http://pastebin.com/fGqMhZSH
[20:15:53] <steeze> i didn't write the returnSearchJson, i'm just trying to get it to match substrings
[20:15:58] <steeze> i think mongo calls them phrases
[20:16:08] <StephenLynx> ah
[20:16:14] <StephenLynx> I get what you are doing now.
[20:16:18] <StephenLynx> nvm what I said before.
[20:16:23] <steeze> :)
[20:16:34] <steeze> so yeah i tried building out the query string with double escape and single escape
[20:16:50] <StephenLynx> are you printing the final string you are building?
[20:16:54] <steeze> hardcoding "\"sta\"" in my query works, but not when i pass that exact string in programmatically
[20:16:57] <StephenLynx> it might not be working as you expect
[20:17:28] <steeze> i did print out searchTextString. the code you see now logs "\"sta\""
[20:17:40] <steeze> which is what works when hardcoded in the query
[20:18:15] <steeze> maybe i need to pass in the string \"sta\" ?
[20:18:42] <StephenLynx> let me check how I did it
[20:18:50] <StephenLynx> I think I implemented something like that on a project
[20:18:58] <steeze> that would be awesome. i assumed i wasnt the first to need something like this
[20:19:51] <StephenLynx> I used $regex on my project
[20:20:06] <StephenLynx> url : {
[20:20:06] <StephenLynx> $regex : parameters.query
[20:20:06] <StephenLynx> }
[20:20:56] <steeze> not sure how id do that since the passed in query is completely arbitrary
[20:21:01] <steeze> or maybe im not looking at the documentation right
[20:21:26] <steeze> passed in text to query for is arbitrary*
[20:23:16] <steeze> im just wanting to quickly return records that have that substring contained anywhere in their text fields
[20:24:03] <StephenLynx> try regex instead of text
[20:24:23] <steeze> can you elaborate? not sure what regex i would build to match a completely arbitrary search term
[20:25:23] <StephenLynx> afaik you just pass a string
[20:25:27] <steeze> maybe i can programmatically build a regex that just matches anything with the substring i pass in
[20:25:34] <steeze> cool lemme try
[20:27:18] <steeze> i don't think it's quite possible to do what i want to do
[20:27:20] <steeze> with $text
[20:36:30] <steeze> sorry about that, they're replacing the modem at my work
[20:36:46] <steeze> so yeah it doesn't look like $text supports any kind of wildcard or anything
[20:40:04] <steeze> yup see https://jira.mongodb.org/browse/SERVER-15090
[20:50:13] <mick27> hey folks, should I specify a db for my backup user if I want it to be able to mongodump everything ?
[20:50:25] <mick27> like the admin db, or should I skip to set any db
[22:12:56] <MacWinner> is there a bug with the Perl MongoDB package? It seems to use a minimum of 100MB resident ram
[22:23:45] <pasichnyk> I currently am running a cluster of 3 replicasets across a set of servers (each running multiple mongod instances, one per replicaset). I needed to do this to logically partition things, and the sets should fit fine given the server specs. However i'm seeing the mongod processes on one of my sets getting killed of once in a while, due to OOM. This set has a lot of data, and is wiredtiger,
[22:23:46] <pasichnyk> but is basically insert only. It looks like i can tune down my cache size on this set, as i rarely query it. Is that my only option to limit memory on these instances so they don't get killed off randomly?
[22:53:16] <bigstacks_> Greetings!
[22:53:44] <Boomtime> hi there
[22:54:12] <bigstacks_> Got a question about arrays. I have a collection that contains documents which have arrays within them. In this particular case, each document has an array of two integers representing time values. I want to sort the documents based on one of the array values, initially the first.
[22:54:28] <bigstacks_> I can't seem to use "entries[0]" as a locator. Is there a way to do this?
[22:55:02] <Boomtime> have you tried "entries.0" ?
[22:55:02] <bigstacks_> In other words, each document has a start and an end time, and I want to sort the documents by their start times.
[22:55:32] <bigstacks_> but I can't use: find().sort({entries[0]:1})
[22:56:01] <bigstacks_> Actually no - I should have. One sec.
[22:57:12] <bigstacks_> No, it says "unexpected number"
[22:59:55] <bigstacks> hmm
[23:01:00] <bigstacks> I can't find anything in the docs about referring to specific array items
[23:01:15] <bigstacks> Not anonymous ones anyway
[23:06:22] <StephenLynx> you refer to the index
[23:06:31] <StephenLynx> or use $ if you queries for something on the array
[23:06:50] <bigstacks> I want to sort documents based on specific array elements
[23:07:06] <bigstacks> like: find().sort({entries[0]:1})
[23:07:23] <bigstacks> to sort the collection based on the first entry, ascending.
[23:07:24] <StephenLynx> you need to use dot notartion
[23:07:28] <StephenLynx> 'entries.0'
[23:07:30] <bigstacks> entries.0 doesn't work
[23:07:37] <StephenLynx> you tried as a string?
[23:08:03] <bigstacks> ah - just did now, and it actually works. Thanks!
[23:21:28] <bperry> hi, can you specify a compiler with scons to build mongodb?
[23:21:38] <bperry> CC/CXX don't seem to be respected
[23:21:56] <bperry> I see them in the SConstruct though
[23:31:50] <bperry> if not, what's the correct/best way to specify a custom compiler?
[23:41:34] <skot> specify the options: CC=gcc-4.8 CXX=g++-4.8
[23:41:54] <skot> why don't you think they are respected?
[23:42:23] <skot> I compile like that.
[23:43:45] <bperry> I specify CXX=clang++ and it still uses G++
[23:44:22] <skot> what version are you using and what is your full scons line?
[23:44:52] <skot> (version of source, for mongodb)
[23:45:06] <bperry> cloned from git just a few minutes ago
[23:45:21] <bperry> CC=clang CXX=clang++ scons all
[23:45:34] <bperry> after that, scons prints
[23:45:37] <bperry> Checking if C++ compiler "g++" is GCC... (cached) yes
[23:45:37] <bperry> Checking if C compiler "gcc" is GCC... (cached) yes
[23:45:50] <bperry> and continues compilation with g++
[23:45:53] <skot> oh, they are not env-vars
[23:46:06] <bperry> are they args to scons?
[23:46:09] <skot> scons CC=clang CXX=clang++ all
[23:46:10] <skot> yep
[23:46:13] <bperry> I see
[23:46:47] <bperry> CCFLAGS same way I assume then?
[23:46:55] <bperry> will find out shortly I guess :P
[23:46:58] <skot> yep
[23:47:16] <bperry> perfect
[23:47:18] <bperry> thanks a bunch
[23:47:30] <skot> np, enjoy...