PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 4th of August, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:33:00] <crazydip> is it possible to set cacheSize to < 1 GB? storage.wiredTiger.engineConfig.cacheSizeGB takes int, which means 0.5 errors out.
[01:03:30] <tdelam> Hi guys, I have these 2 models like so: https://gist.github.com/tdelam/00056e783a7e386a2eb3 with this structure, I need to be able to query all products of a certain type. E.g: "Select all products of type 'computers'" - I thought I can do something like > db.inventory.products.find({ 'type.shortCode': 'computers' }) to get products of that type. How can I get all products of a certain type with this structure?
[01:08:58] <joannac> tdelam: mongoose?
[01:09:09] <tdelam> yes, joannac
[01:09:20] <joannac> mongoose does some crazy "join"
[01:09:25] <joannac> in the shell, that's 2 queries
[01:10:06] <tdelam> Oh. I guess I would do .populate() in my code then. I am just trying to build my query first
[01:10:38] <joannac> that seems fine but I have no idea how the crazy mongoose joins actually work
[01:10:58] <tdelam> me neither :) Its hard to find more info about this.
[01:21:51] <morenoh149> tdelam: it's just populate
[01:32:51] <StephenLynx> tdelam I suggest you don`t use mongoose.
[02:08:30] <jaitaiwan> Any pymongo users in here?
[02:15:45] <tdelam> morenoh149: thanks :)
[02:20:18] <joannac> jaitaiwan: if you have a question, just ask
[02:20:58] <jaitaiwan> Thanks joannac: was just having trouble navigating the docs. I was looking for findandmodify with the remove argument.
[02:26:45] <joannac> why can't you jsut do a remove?
[06:04:54] <kmtsun> Hello everyone
[06:08:51] <Boomtime> hi there
[07:26:02] <jamiel> If my shard key is foo, and I have a { foo: 1} index but also compound index { bar: 1, baz: 1 } ... if I include the shard key in my { bar: 1, baz: 1 } query will both indexes be used or should I be including the shard key in every index where it makes sense (index size is already a problem for us hence trying to cut down)
[07:30:19] <joannac> no, one index per query except for exceptional circumstances
[07:30:46] <joannac> does it make sense to query on foo as well as bar or baz?
[07:33:57] <jamiel> the query works without foo, but won't that help the config servers find the shard?
[07:35:00] <jamiel> I'd expect mongo-config to use foo to find the shard, then the mongod to use foo index initially then intersection with the compound index
[07:37:44] <Boomtime> jamiel, if your data is distributed across shards based on the content of 'foo', how would a query on 'bar' and 'baz' possibly restrict to a particular shard?
[07:38:32] <Boomtime> if you can construct a query which includes the shard key as a predicate then the routers are able to direct the query to the applicable shards
[07:40:05] <jamiel> foo and bar are one to many so it will restrict in most cases unless it's been chunked
[07:40:41] <Boomtime> is only foo is in the shard key?
[07:41:05] <Boomtime> if foo is the only field in the shard key, it is the only predicate that can affect query routing
[07:42:01] <jamiel> Indeed, which is why I'd like to include it in the query but then I need to add it to practically every index
[07:45:13] <jamiel> seems like an awful waste it's a 5GB index by itself and across 4 collections with multiple indexes and similar structure that change we're talking about an extra 35-50GB of indexes = RAM :(
[07:45:14] <Boomtime> jamiel, are you saying that your queries today _could_ be including the shard key but aren't?
[07:45:19] <jamiel> yes
[07:45:28] <Boomtime> um..
[07:47:42] <jamiel> it's not needed apart for routing in most of the queries and is just extra scan and extra space, but at the point where need to start thinking about routing speed
[07:48:58] <jamiel> Was hoping multiple indexes could just be used ... one foo index to satisfy the routing and lookup for all queries and then the compound indexes get used through intersection .. but sounds like that's not how it works and I need foo in every index now?
[07:49:12] <Boomtime> ok, so when it comes to routing queries, the mongos and the shards are independent
[07:49:27] <Boomtime> that is, the mongos routes based on the shard key information it has
[07:49:47] <Boomtime> but the shards determine for their own self what index will be used to satisfy the query as they have received it
[07:50:22] <Boomtime> i.e there is nothing to stop you from adding the shard key predicate to your queries then simply watching what happens
[07:50:51] <Boomtime> the mongos will route better because it will observe routing information given via the shard key predicate
[07:51:11] <Boomtime> the shards however will now have 2 competing indexes to race occasionally when planning the resolution of such a query
[07:51:50] <jamiel> So I could append the shard key to queries simply for routing purposes? :) If I prepend it on current setup explain() tells me that my foo index is being used not my compound index
[07:52:12] <Boomtime> because it isn't a compound index
[07:53:16] <Boomtime> wait.. you say the shards changed to using the shard index rather than your bar/baz index?
[07:54:44] <Boomtime> i would be interested in seeing the output of explain(true)
[08:12:04] <jamiel> Boomtime, took a while for it to finish, but results are SINGLE_SHARD query winning plan my compound index ... but it was incredibly slow presumably because it had to do a full document scan on foo without an index after it had looked up bar,baz?
[08:13:09] <jamiel> I can see totalKeysExamined === totalDocsExamined
[08:13:50] <jamiel> (602857 in this case)
[08:14:55] <jamiel> Why wouldn't intersection be used to avoid that?
[08:21:24] <Boomtime> jamiel: there should be multiple plans shown for the shard that it hit - what does the plan for bar/baz show?
[08:59:34] <fontanon> Hi everybody, how to fix a 'chunk too big to move' failure? I'm on mongodb-org 3.0.2
[09:00:57] <ksmtk> hey
[09:01:36] <ksmtk> I've setup mongo on ubuntu server, added admin and regular user
[09:01:43] <Progz> Hi, I have got some issue with my replica server. I have 3 mongo server in replication. 1 Primary, 2 Secondary, everybody can vote. I have got 3000 websites requesting in to this mongo replica. I don't know why some request taking a long time.
[09:01:47] <Progz> See here : http://pastebin.com/m25eni9N
[09:02:20] <Progz> The 3 servers mongo got the same hardware. 2 CPU et 15 GB ram. Index size = 2,8 Gb. Engine : WiredTiger
[09:02:32] <ksmtk> and successfully connect via mongo shell like mongo <IP>/admin -u <username> -p<password>
[09:02:39] <joannac> fontanon: that sounds like you have a bad shardkey
[09:02:45] <ksmtk> but connecting via robomongo fails
[09:02:50] <ksmtk> any ideas?
[09:03:04] <Progz> ksmtk, robomongo doesn't support the last vrsion of mongo
[09:03:07] <joannac> Progz: explain(true)
[09:03:25] <ksmtk> hmm
[09:03:29] <fontanon> joannac, is tag aware sharding based on dates
[09:03:46] <ksmtk> Progz: also on windows shell connection also fails
[09:03:59] <ksmtk> (I'm on mac - it works)
[09:04:14] <joannac> ksmtk: what version of the shell on windows?
[09:04:25] <ksmtk> 3.0.4
[09:04:34] <ksmtk> on mac as well 3.0.5
[09:04:38] <joannac> and the exact same connection string fails?
[09:04:38] <ksmtk> 3.0.4
[09:04:42] <ksmtk> yep
[09:04:52] <joannac> I call BS
[09:05:03] <ksmtk> ?
[09:05:12] <Progz> joannac, http://pastebin.com/Mq7jjGcv with explain(true)
[09:05:20] <joannac> unless you're hitting some kind of encoding bug, you've typoed
[09:05:41] <ksmtk> hmm
[09:05:45] <ksmtk> that's weird
[09:06:11] <ksmtk> I have pass in md5 like 5ce06e46867de8252365147b667f1c20
[09:06:11] <Progz> ksmtk, maybe network problem ? telnet IpOfYourMongo 27017 work ?
[09:06:11] <joannac> Progz: that takes 0 millis
[09:06:51] <ksmtk> Progz: we're on same network
[09:07:28] <Progz> ksmtk, ok but let's try. Maybe you got some iptables rules config by default
[09:07:40] <Progz> I don't use ubuntu often
[09:08:12] <ksmtk> telnet <IP> 10002
[09:08:12] <ksmtk> Trying <IP>…
[09:08:12] <ksmtk> Connected to ec2.eu-west-1.compute.amazonaws.com.
[09:08:14] <ksmtk> Escape character is '^]'.
[09:08:19] <Progz> arf
[09:09:26] <Progz> joannac, yeah when I restart the mongo server, it is very fast. But when I start apache and all the front website requesting in to mongo. Load average on the mongo server are increasing and request taking more and more time.
[09:11:18] <ksmtk> btw what is the last version of mongo is supported in Robomongo?
[09:11:45] <Progz> one hte official website : Note: We are working on an update with MongoDB 3.0 compatibility for the upcoming Robomongo 0.9.x release series.
[09:12:38] <ksmtk> oh.. that's crazy..
[09:13:01] <Progz> yeah we stop using robomongo since 3.0.0... too much bug
[09:13:11] <Progz> some collection or index invisible on robomongo
[09:15:34] <Progz> joannac, just to be sure. in the log file : when I see IXSCAN, this is the index use for the query ?
[09:15:38] <Progz> Example :
[09:15:39] <Progz> 2015-08-04T10:00:29.602+0200 I QUERY [conn1774] query fortress.Page query: { domain: "test.com", url: "blob1.html" } planSummary: IXSCAN { domain: 1.0, url: 1.0, publication_date: 1.0 } ntoskip:0 nscanned:1 nscannedObjects:1 keyUpdates:0 writeConflicts:0 numYields:5 nreturned:1 reslen:6243 locks:{ Global: { acquireCount: { r: 12 }, acquireWaitCount: { r: 1 }, timeAcquiringMicros: { r: 322109 } }, Database: { acquireCount: { r: 6 } }, Collection: { acquir
[09:15:39] <Progz> eCount: { r: 6 } } } 1738ms
[09:20:11] <ksmtk> I've created a question http://stackoverflow.com/questions/31805302/mongodb-authorized-connection-works-on-mac-shell-but-fails-in-macs-robomongo
[09:20:25] <ksmtk> maybe someone have something to suggest
[10:34:03] <amz3> héllo, I'm using wiredtiger library, is it ok to ask questions about it in this channel?
[10:35:52] <Derick> library? or storage engine for MongoDB?
[10:36:38] <amz3> wiredtiger the storage engine of mongodb, but since it's mongodb database, I wondering if this channel provides some kind of support for it
[10:36:46] <amz3> it's not mongodb
[10:38:17] <amz3> I'm (re) building a ffi bindings of wiredtiger in guile. The bindings were working correctly until I moved to ffi bindings. the ffi bindings works great if I do not use transactions. If I use transaction, cursor->set-key returns an error 200
[10:39:07] <amz3> sorry the error is 192 if I don't provide an isolation level
[10:40:19] <amz3> the error is 192 for isolation level in (read-uncommited, read-uncommited, empty) but 200 if I use "snapshot"
[10:41:09] <amz3> ffi bindings is kind of detail, my question is about those error codes, I can figure where they are from. I grepped the source, but can't find them
[10:53:26] <amz3> session->strerror says the error is unknown
[10:53:47] <amz3> well, this is probably a problem with my code, I though someone could help me with the error
[12:33:18] <amz3> I found my error. I was checking for the return code of cursor->set_key(item) except it doesn't return an error code; it has void as return signature
[12:34:31] <amz3> and it's correctly explained in set_key documentation
[12:34:35] <amz3> :)
[12:34:48] <amz3> which means my bindings work :)
[12:54:12] <amz3> I am free to build my mongodb competitor ;)
[12:57:52] <StephenLynx> lel
[12:58:12] <StephenLynx> are you going to fork mongo?
[12:58:39] <amz3> nah, I'm going to write all the thing in scheme
[12:58:55] <StephenLynx> :v
[12:58:59] <amz3> :)
[12:59:27] <amz3> no really it's far from being a mongodb competitor it's more like sqlite graph database with multithread support
[12:59:38] <Folkol> Sounds like a fun project :) Is it open source?
[13:00:06] <StephenLynx> gentle reminder free software != open source
[13:00:16] <amz3> thx, yes, I am the beginning though, I wrote something similar in python, now I'm writing it scheme
[13:00:25] <StephenLynx> why scheme though?
[13:01:05] <amz3> honestly
[13:02:09] <amz3> 0) I'd like to learn scheme 1) GNU Guile has a powerful VM 2) I did my share of python coding
[13:02:20] <amz3> s/VM/scheme VM/
[13:02:27] <StephenLynx> hm
[13:02:52] <amz3> I know it doesn't sound very corporate/startup-ish
[13:03:05] <StephenLynx> yeah, sounds didactic
[13:03:17] <StephenLynx> like everywhere I see scheme mentioned.
[13:04:59] <amz3> (sorry got into trouble)
[13:05:35] <Folkol> No, open source is not the same as free software. The reason why I asked is that I got intrigued, and wanted to read some code :P
[13:06:03] <amz3> I did a similar project in python http://pypi.python.org/pypi/ajgu it use bsddb
[13:06:19] <amz3> yes, I have code, but it's kind of small. I will update it the latests improvements
[13:06:22] <amz3> scheme code
[13:10:39] <amz3> the code of the graphdb in scheme can be found @ https://git.framasoft.org/snippets/51
[13:10:56] <amz3> well bindings are also on the same website but it might not be what interst you
[13:13:40] <amz3> well, to add more background to project and maybe help(?) mongodb, my interest is to have a very easy (like sqlite) to setup database, but with the power of graphdb/mongodb
[13:14:11] <amz3> my understand is that mongodb is for big projects, whereas my interest is in "small scale" development
[13:19:54] <kfirfer> Hello, someone here assign to the course java mongodb in mongodb website?
[14:27:25] <devastor> Hi all, does anyone know if there was some big changes to index building in 2.6? a resync with 2.4 previously took about 2 weeks (mainly building a big index of an array field), but with 2.6 it apparantly completed successfully in about 2 days. Is that expected?
[17:42:45] <crazydip> Can someone point me to the reasoning why MongoDB requires gcc >= 4.8.2 and not 4.8.1 or just 4.8? What's so special about 4.8.2?
[17:43:33] <crazydip> or was this just arbitrarily chosen because that's what compilation was tested on?
[18:21:31] <jayjo> Does anyone have a good resource to stream server-sent events to a mongodb?
[18:49:48] <morenoh149> what can I run to recover an unclean mongo shutdown?
[18:50:10] <morenoh149> crazydip: who knows. just upgrade
[18:51:16] <crazydip> morenoh149: Not the reason I ask... I'm building packages.
[18:51:27] <morenoh149> ask on the github then
[18:52:12] <morenoh149> jayjo: what kind of server sent event? If a server is sending messages just point it at mongo and it'll be recorded
[18:52:44] <jayjo> morenoh149: it's sending data and event messages
[18:55:20] <morenoh149> jayjo: maybe http://docs.mongodb.org/ecosystem/tools/http-interfaces/
[18:56:31] <cheeser> no, that's not it
[18:56:58] <cheeser> you'll need to write something to collect the events and dump them to mongodb
[18:59:15] <jayjo> cheeser: application level?
[19:00:10] <cheeser> yeah
[19:06:05] <morenoh149> jayjo: what are you making? because shouldn't the driver be communicating with the database
[19:33:19] <EllisTAA> can someone recommend a tutorial on hooking up my js app to mongodb?
[19:38:59] <StephenLynx> http://mongodb.github.io/node-mongodb-native/2.0/api/ EllisTAA
[19:39:19] <EllisTAA> stephenlynx: boss! ty
[19:54:41] <virani> Hi
[19:54:59] <virani> I have started learning mongodb
[19:55:18] <virani> I am facing issue in creating Spring Data MongoDB query
[19:55:33] <virani> I have status collection which has four fields abc, xyz, status, time
[19:55:58] <virani> I can write MySQL query:
[19:56:02] <virani> select * from status where abc = false and xyz = true and (status = pending or (status = inprogress and time = "2015-08-04"))
[19:56:24] <virani> how can I write it in MongoDB
[19:56:26] <virani> how can I write it in MongoDB?
[19:56:41] <virani> Basically status can be pending or inprogress but if it is inprogress then time must be compare.
[20:02:05] <StephenLynx> that is an issue with spring, imo
[20:06:40] <virani> StephenLynx, is there any other alternatives?
[20:06:47] <StephenLynx> not using spring.
[20:07:01] <virani> :)
[20:07:10] <virani> it is heavily used in my application
[20:07:17] <StephenLynx> hm
[20:07:17] <TU> Is there any difference between a mongo index created like {a: 1, b: 1} bs {b:1, a: 1}? I'm trying to create a compound index over two fields and i want to ensure that the more unique field is used for the first layer of looking through the index (essentially trying to create a multi-column sql index where you can control the order of the columns in the
[20:07:17] <TU> index)
[20:07:39] <StephenLynx> TU I guess the order matters.
[20:08:25] <TU> so the order of the keys in the JS object determines which field it'll look at first when diving into the index?
[20:11:11] <StephenLynx> I am not sure, but I think it does.
[20:41:40] <EllisTAA> what the hell is an aggregation cursor
[20:41:59] <Derick> it's a cursor to aggregate over aggregation results?
[20:44:14] <StephenLynx> I thought aggregations would only return an array :v
[20:44:37] <cheeser> nope. cursors as of 2.6
[20:44:37] <StephenLynx> look at that
[20:44:58] <StephenLynx> so I guess I am using aggregations wrong lel
[20:49:04] <EllisTAA> whats a curosor then
[20:53:48] <Derick> it's a handle on the driver side, that a driver can use to fetch subsequent results from the server
[20:54:22] <StephenLynx> it enables you fetching results in parts instead of getting all results at once from a query
[20:54:32] <StephenLynx> imagine having to hold a million documents at once.
[21:13:30] <topwobble> Does anyone know how to make a custom Mongoose transform on incoming data? I'd like to add a field called __length that indicated the length of the JSON received over the network
[21:14:05] <topwobble> I'd like to specify my own toObject() method so I can add on the __length field when I parse the json into an object
[21:19:09] <n_i_c_k> Hi
[21:20:42] <n_i_c_k> whats the best way to test map reduce quickly
[21:20:45] <n_i_c_k> any tutorial ?
[21:21:03] <Derick> it's difficult
[21:21:13] <n_i_c_k> shy
[21:21:15] <Derick> I would suggest that you look at the aggregation framework instead first
[21:21:15] <n_i_c_k> why
[21:22:49] <Derick> it's faster, and uses indexes, and you can just try it stage by stage
[21:22:53] <Derick> M/R is just all or nothing
[21:26:42] <n_i_c_k> Derick: i need to find a shortest path from nodes.. ie A B 10, B C 50, C D 43, C E 32 etc... then i must calculate whats the lowest value from A to E
[21:26:51] <n_i_c_k> i thought solving it using map reduce
[21:26:59] <n_i_c_k> do you think its a proper tool ?
[21:28:55] <jpfarias> hi guys
[21:29:56] <jpfarias> I just found out that doing queries with $all is pretty slow and that is even noted in the documentation, what would be a faster alternative to an $all query?
[21:33:35] <Derick> n_i_c_k: sounds like you'd want a graph database?
[21:34:33] <n_i_c_k> Derick: hmmmmm maybe... im not sure.. why do you think that would be better ?
[21:34:54] <n_i_c_k> because its a graph
[21:35:01] <Derick> n_i_c_k: well, they model relations between entities (your nodes A B C D E)
[21:35:06] <n_i_c_k> shortestpath = graph
[21:35:11] <n_i_c_k> yes
[21:35:19] <n_i_c_k> ok i will look!
[21:35:29] <n_i_c_k> any specific sugestion ? i thought orientdb
[21:37:37] <Derick> have a look at that, or perhaps neo4j
[21:37:42] <Derick> I'm not too familiar with them
[21:38:41] <n_i_c_k> thanks a lot Derick
[21:39:09] <cheeser> neo4j is probably the most popular graph db out there.
[21:43:23] <devastor> Hi all, does anyone know if there was some big changes to index building in 2.6? a resync with 2.4 previously took about 2 weeks (mainly building a big index of an array field), but with 2.6 it apparantly completed successfully in about 2 days. Is that expected?
[21:54:46] <EllisTAA> can someone tell me the difference btwn these two lines? https://gist.github.com/ellismarte/5f53c06cc13b9b87b6b1
[21:58:58] <kenalex> hello
[22:12:39] <blizzow> My mongod instances of my sharded cluster sometimes experience hangtime. When I try: mongo localhost/admin -u myuser -p mypassword it will connect but then take a long while for the mongo> prompt to show up. I don't see any errors in my logs, and the slow connections don't seem to correlate to any database activity, I don't see I/O wait, or heavy CPU spikes during these brownouts either. How can I figure out what the issue is on these intermittent slow c
[22:13:21] <blizzow> I'm running mongo 3.0.5 on ubuntu 14.04.2 with all the latest and greatest patches installed.
[23:19:36] <leptone> how do i know if my mongoldb database is running?
[23:28:35] <EllisTAA> leptone: try testing it
[23:30:21] <EllisTAA> i set up my schema in my mean stack app, but where do i define the db?
[23:34:27] <EllisTAA> can someone tell me what is going on in this line? it is requiring models/models.js but what is models.js returning? https://github.com/hwz/chirp/blob/master/chirp/app.js#L10
[23:53:44] <leptone> so the command mongod tells you system which MongoDB server to connect to?