PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 14th of May, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:00:08] <alexband> hi, all, I started a secondary node, want to sync with primary (both mongodb 3.0), but I always get socket timeout error
[04:00:09] <alexband> https://bpaste.net/show/48ea573e8def
[04:00:22] <alexband> does anybody can give me any hint?
[04:40:07] <kwallbmoc> Anyone here familiar with the Java driver?
[05:40:15] <sabrehagen> for two databases (e.g. localhost:27017/db1 and localhost:27017/db2), does inserting data in db1 put a write lock on db2?
[05:41:38] <sabrehagen> (and is there any difference in this activity between 2.6 and 3.0?)
[07:15:11] <amitprakash> Hi, I can connect and authenticate to a database as db = MongoClient('host:port')['database'].authenticate(user, pass) and execute queries as db[collection].find().count()
[07:15:49] <amitprakash> However, when I try to authenticate via mongo client as mongo host:port/database -u user -p pass it throws { ok: 0.0, errmsg: "auth failed", code: 18 }
[07:15:58] <amitprakash> Why so?
[09:15:41] <abyss> To set range for sharding mostly I should use id key for my data in mongodb? So: sh.shardCollection(database.foo,id) should be enough?
[09:15:54] <abyss> for most cases
[10:12:00] <joannac> abyss: um, no, sharding on the default _id is a terribl idea
[11:09:42] <pamp> @joannac why sharding on default _id is a terrible ideia?
[11:24:10] <amitprakash> Hi, I can connect and authenticate to a database as db = MongoClient('host:port')['database'].authenticate(user, pass) and execute queries as db[collection].find().count()
[11:24:12] <amitprakash> However, when I try to authenticate via mongo client as mongo host:port/database -u user -p pass it throws { ok: 0.0, errmsg: "auth failed", code: 18 }
[11:30:19] <sabrehagen> my mongod service is only listening on 127.0.0.1. how do i get it to listen externally?
[11:36:13] <Derick> on the cmd line it's --bind_ip 0.0.0.0 I *think*
[11:36:30] <Derick> but, I think by default it should bind to all IPs
[12:54:17] <mitereiter> hello
[12:54:57] <mitereiter> can someone help me with Tag-Aware Sharding?
[13:14:44] <joannac> mitereiter: you'd get better results if you actually asked your question
[13:19:30] <mitereiter> thank you
[13:24:56] <jecran> Good morning mongo land. I am having issues with an import command from the command line: mongoimport --db test --collection restaurants --drop --file primer-dataset.json . Pulled straight from the site, and I keep getting an Unexpected identifier error. Quotes maybe?
[13:25:40] <goldstar> how would I got about removing records that are a month old from my db ?
[13:26:17] <joannac> jecran: why is there a dot at the end?
[13:26:35] <jecran> Cause I like to pretend I know some English :P
[13:26:39] <StephenLynx> goldstar from what I know, you can get the insert date from the default _id object.
[13:27:06] <joannac> jecran: oh. my bad.
[13:27:15] <joannac> jecran: the json is definitely good?
[13:27:39] <StephenLynx> so you could use in the match block for removal this date with the operator lt and a date of the current date - a month
[13:27:41] <jecran> Yeah I'm just starting the tutorial and I cant get past the first line. Download the file straight from the site too
[13:27:51] <StephenLynx> what is your distro?
[13:28:04] <StephenLynx> you don't need to download, you can add the repository to your package manager.
[13:28:30] <jecran> I am using v3.0.2
[13:28:32] <joannac> jecran: which tutorial?
[13:28:39] <StephenLynx> no, your distro.
[13:28:46] <jecran> http://docs.mongodb.org/getting-started/shell/import-data/
[13:28:53] <StephenLynx> ah
[13:29:01] <StephenLynx> I mixed the two guys :v
[13:29:11] <StephenLynx> I was talking to gold
[13:29:23] <jecran> ok
[13:30:57] <joannac> jecran: I just tried it, works for me
[13:31:12] <jecran> lol wth
[13:31:24] <joannac> jecran: so there's nothing in that collection?
[13:31:34] <joannac> i.e. not a single document gets inserted?
[13:32:07] <joannac> jecran: are you by chance trying to do this in the mongo shell?
[13:32:20] <jecran> Nothing being "imported" I can do a regular database, add a collection, then save and it works fine. Just the import I am stuck on. And yes, on the command line
[13:32:43] <joannac> jecran: on the command line, in a terminal?
[13:32:54] <joannac> jecran: or the command line *in a mongo shell*?
[13:32:59] <jecran> yes. mongod running in 1 terminal, and regular mongo in another
[13:33:05] <joannac> right
[13:33:08] <joannac> mongoimport is a tool
[13:33:14] <joannac> use it in a terminal
[13:33:20] <joannac> *not* in the mongo shell
[13:33:33] <jecran> Thank you. :P
[13:33:45] <joannac> working?
[13:33:54] <jecran> Yes hehehe
[13:33:58] <joannac> awesome
[13:34:14] <jecran> I thought this was all done in the shell
[13:34:20] <joannac> jecran: the doc you linked says "In the system shell or command prompt" - is that confusing?
[13:34:26] <joannac> should it be reworded?
[13:34:53] <jecran> lol maybe bold haha
[13:34:58] <joannac> lol
[13:36:55] <jecran> @joannac: this is the start to my day ,,, oh boy
[13:44:50] <abishek> is this condition correct? `"geo_country_iso" : {"$ne": [null,""]}`
[13:53:03] <amitprakash> Hi, I can connect and authenticate to a database as db = MongoClient('host:port')['database'].authenticate(user, pass) and execute queries as db[collection].find().count()
[13:53:04] <amitprakash> However, when I try to authenticate via mongo client as mongo host:port/database -u user -p pass it throws { ok: 0.0, errmsg: "auth failed", code: 18 }
[13:53:05] <amitprakash> any ideas why?
[13:53:12] <pamp> Hi
[13:53:20] <pamp> how can I Unshard a collection
[13:54:43] <pamp> I already remove the collection, but when I run sh.status() the collection still appears
[14:08:45] <abyss> joannac: _id for sharding is a bad idea because it's an arbitrary value?
[14:09:39] <abyss> I mean variable, not order
[14:38:47] <GothAlice> abyss: Sharding on _id is perfectly acceptable… if what you want is pseudo-random (but even) distribution of your data across shards.
[14:48:27] <fewknow> blamo
[15:24:20] <Thinh> Hi guys! Got a question regarding mongos
[15:24:25] <Thinh> Anyone seen this error before? https://gist.github.com/Taik/e42639ff7f68af3a4eb8
[17:00:18] <alobodig> Hi. Is using the positional projection operator ($) supported in the ‘fields’ part of a findAndModify command? e.g.: db.col.findAndModify({ query: { ’array.val’: 0 }, update: { $set: { ‘array.$.val’: 1 } }, fields: { ‘array.$’: true } }); It seems like it interprets the $ as the name of a field in array, but I might be overlooking something.
[17:26:01] <girb1> Hi Please help new to mongodb
[17:26:26] <girb1> http://pastebin.com/9zK1sT7V .. does mongo 3.0.3 support cleanupOrphaned command
[17:26:27] <girb1> ?
[17:28:43] <StephenLynx> http://docs.mongodb.org/manual/reference/command/cleanupOrphaned/ it seems so.
[17:36:05] <godzirra> Using the node mongo driver, how do I see the query I created? I'm trying to do a query by date, but in node it's not working, so I'm pretty sure I'm doing somethign wrong, just not sure what, and not sure how to view the query.
[17:36:46] <StephenLynx> you see the code you wrote.
[17:37:22] <StephenLynx> I don't remember seeing a way of getting the query the driver formed with the objects and array you provided and I have been using that driver for almost a year now.
[17:38:41] <godzirra> StephenLynx: The code I wrote looks correct to me, but it's obviously not. :) Here's the code I'm using: https://gist.github.com/slooker/0417d60841c2f70c99d7
[17:39:18] <Spec> can you just turn on query logging on mongo?
[17:40:05] <StephenLynx> 1- format the code, it makes much easier to understanding it. 2- I am pretty sure you must pass a callback to find to get the pointer you convert to array.
[17:40:17] <StephenLynx> to understand it*
[17:40:32] <StephenLynx> personally I use nodeclipse, a plugin for eclipse.
[17:40:51] <StephenLynx> but given how bad eclipse can be, I understand if you chose not to.
[17:41:48] <godzirra> I'm not really suer what you mean about formatting the code. the reply is indented, I just forgot the closing brace to the collection.
[17:42:11] <godzirra> StephenLynx: And this code works exactly as is if I remove the "dateCreated" section from the query.
[17:43:45] <StephenLynx> https://gitlab.com/mrseth/lynxchan/blob/master/src/be/public/boardDetails.js#L61 godzirra
[17:44:04] <StephenLynx> that is a formatted query object.
[17:44:30] <StephenLynx> https://gitlab.com/mrseth/lynxchan/blob/master/src/be/public/boardDetails.js#L168 another query, without the block declared on a separate place.
[17:44:53] <StephenLynx> when you declare json objects completely lined it becomes really hard to understand their structure
[17:46:41] <girb1> In mongo 3.0.3 how to clean up the orphaned data ?
[17:47:11] <StephenLynx> have you read the link I pasted from the docs?
[17:49:36] <girb1> StephenLynx: yes .. I recently upgraded from 2.7 to 3.0 .. there seems to be orphaned data when I check it through db.colection.getShardDistribution() … the data is less here when compared to "show dbs"
[18:00:57] <vzp_> Can I have different mongo versions in a replica set? In my case I want to have 2.6 and 3.0
[18:02:58] <cheeser> yes
[18:07:04] <vzp_> cheeser: thanks.
[18:20:59] <abyss> GothAlice: ok, thank you. So it's good for hash shard key I guess?
[18:21:25] <GothAlice> It's acceptable; depending on data usage there may be more optimal ways to organize your data.
[18:21:42] <GothAlice> (If you can avoid queries needing to merge responses from multiple shards, you win.)
[18:23:20] <abyss> ok. Thank you.
[18:38:03] <StephenLynx> GothAlice when you open a gridfs file on write and close it, when you open and write again will it first remove all previous data or keep writing from where it stopped since you last opened it?
[18:38:56] <GothAlice> StephenLynx: MongoDB is effectively stateless, so no, if you re-open the "file" and start writing again, it'll have a local file pointer of zero, i.e. the beginning of the "file".
[18:39:17] <GothAlice> s/effectively stateless/effectively stateless for this use/
[18:39:27] <StephenLynx> and if it writes less data than the file had? what happens to it?
[18:43:23] <GothAlice> That's a very good question. I'd have to double-check the docs and/or code.
[18:43:42] <GothAlice> (I've been auditing too much PHP recently. Can't think straight any more.)
[18:43:49] <StephenLynx> :c
[18:43:52] <StephenLynx> I feel you
[18:44:04] <StephenLynx> had to dig some mud lately too.
[18:44:19] <StephenLynx> to integrate a chat module I designed to the main project.
[18:44:35] <GothAlice> Always fun to run an emergency audit and code cleanup on a 16-year-old e-commerce site that was broken into with multiple exploits. :/
[18:45:03] <greyTEO> GothAlice, PHP is good for the soul!
[18:45:05] <GothAlice> (The "mysqli" upgrade for it was… painful. I'm pretty sure this is PHP 3 code.)
[18:45:32] <StephenLynx> greyTEO PHP is a hellspawn
[18:45:45] <StephenLynx> I had to fiddle with its C source code lately
[18:46:06] <StephenLynx> it didn't worked with an updated version of a dependency because of a hack of the developers.
[18:46:07] <faux___> i need help designing a database. nosql databases are an option. my data are lisp expressions, eg "(f (g 1) (g 2))". when evaluating the previous expression, i'll need to hit the database for the definitions of "f" and "g". in general, if an expression references other expressions, it should be easy to get to those other expressions. any advice is greatly appreciated
[18:47:05] <greyTEO> StephenLynx, I image the underlining code of terri-bad. Judging by the api.
[18:48:01] <greyTEO> I have been wanting to get into python for a while and Im trying every excuse to use it at work
[18:48:18] <StephenLynx> what purpose would you use python?
[18:48:20] <greyTEO> eeh ehhh my grating to GothAlice task queue using mongo
[18:48:24] <StephenLynx> for what*
[18:48:34] <greyTEO> migrating*
[18:48:37] <GothAlice> StephenLynx: https://gist.github.com/amcgregor/85aedaba24400e73940c
[18:48:53] <GothAlice> StephenLynx: The… fatal security flaw… should be rather apparent.
[18:49:13] <StephenLynx> lol I love having some fun with bad code, lets see
[18:49:51] <greyTEO> Im impressed
[18:50:03] <GothAlice> StephenLynx: I think I've found a convert, using my MongoDB-as-distributed-task-queue solution as bait. ;)
[18:50:25] <StephenLynx> for mongo?
[18:50:35] <GothAlice> Convert to Python. ;P
[18:51:10] <StephenLynx> what did you showed him about python that was so great?
[18:52:02] <GothAlice> StephenLynx: https://github.com/marrow/task#1-what-is-marrow-task
[18:52:57] <StephenLynx> seems that is more about mongo.
[18:53:02] <ngl> Hello. Somebody please answer this question: How do I use mongofiles with a bucket that is not fs? For example: mongofiles -d myDB -c templates get somezip.zip
[18:53:12] <GothAlice> StephenLynx: The end goal of transparently bridging function calls to a distributed cluster, including transparently bridging Python generator functions (iterables that "yield" multiple values before returning), is kinda boss.
[18:53:48] <StephenLynx> I remember sawing the implementation of generators and the yield keyboard on javascript. I gagged.
[18:53:56] <StephenLynx> seeing*
[18:54:04] <ngl> Or, for that matter, even just listing another bucket? This lists fs no problem: mongofiles -d myDB list
[18:55:28] <StephenLynx> keyword*
[18:55:53] <GothAlice> ngl: Great question. --prefix
[18:56:01] <GothAlice> ngl: (--prefix defaults to "fs")
[18:56:30] <GothAlice> Ref: http://docs.mongodb.org/manual/reference/program/mongofiles/#cmdoption--prefix
[18:56:33] <ngl> Bows to GothAlice! Thank you so much, I couldn't seem to find that in the man page. Cheers!
[18:56:49] <GothAlice> It's… not made particularly obvious. Doesn't seem to be in the man page, but is in the online doc.
[18:57:37] <greyTEO> StephenLynx, just moving away from php, I like the idea of a better interpreted language
[18:57:51] <ngl> Thank you very much.
[18:57:55] <StephenLynx> I suggest taking a look at io.js.
[18:58:06] <greyTEO> I have experience in java and c#
[18:58:17] <StephenLynx> so you would appreciate how js has a more C like syntax.
[18:58:30] <GothAlice> Heh. I'll take a step back from language advocacy… not quite the right channel for it.
[18:58:31] <greyTEO> so I like the wild west of dynamic languages...
[18:58:41] <StephenLynx> plus it is non io-blocking, making it great for heavy concurrency scenarios.
[18:58:43] <greyTEO> lol tis true
[18:59:25] <greyTEO> point me to flame war channel!
[19:00:35] <StephenLynx> GothAlice I didn't even figured out what was that code intended to do. why did he went on a loop to append that $?
[19:00:35] <GothAlice> I'm shocked that there wasn't already a ##argument channel. ("I came here for an argument!" "No you didn't.")
[19:00:50] <StephenLynx> prepend*
[19:01:26] <greyTEO> seems like that should be a thing already...
[19:02:19] <GothAlice> StephenLynx: It was a method of slurping in form data and populating a str_replace with all of that data, keys prefixed with $, for replacement in a template string. The security flaw is having a "from" address that includes newlines. >:D
[19:02:41] <GothAlice> (Beyond the code being unintelligible.)
[19:03:37] <GothAlice> Well, ##argument exists now.
[19:04:27] <StephenLynx> lol
[19:06:21] <girb1> I had one replica set at the beginning and I later added 3 replica set and made a sharded cluster …. now the cluster is imbalanced
[19:06:22] <girb1> i.e the first replica set contains more data (about 60%) of data. Balances ir running and its not balancing properly
[19:06:33] <girb1> Is there a way I can stop mongos insterting data into into my first replica set ?
[19:12:31] <ngl> GothAlice, is there a particular version of mongofiles I need to have to use the --prefix flag? I'm running 2.6.9 and am told the flag is unkown.
[19:12:43] <GothAlice> I'm running 3.0.2.
[19:12:46] <GothAlice> Likely it was added in 3.0.
[19:13:19] <ngl> Dang, this is our standard dockerized mongo test container. Versions... Thanks a bunch!
[19:31:54] <ngl> Thanks again. Adios.
[20:14:00] <godzirra> StephenLynx: Meeting hell. Sorry. I reformatted the data and posted it here: https://gist.github.com/slooker/0417d60841c2f70c99d7
[20:14:54] <StephenLynx> yeah, I am almost sure you need to get the result from the callback on the find.
[20:15:04] <StephenLynx> and then run toArray on the cursor.
[20:16:44] <StephenLynx> aah, look at that
[20:16:48] <StephenLynx> find returns a cursor.
[20:16:52] <StephenLynx> I didn't know that :v
[20:17:19] <StephenLynx> so yeah, you are right, nevermind.
[20:18:02] <koboldthegreat> while i was following the mongodb flask tutorial i got this error:
[20:18:07] <koboldthegreat> werkzeug.routing.BuildError: ('posts.detail', {'slug': 'skdfj'}, None)
[20:18:33] <GothAlice> StephenLynx: Find is lazy in every driver I've gone source-diving through. I.e. the result of .find() actually doesn't do much. It's iteration that commits the query and runs it, prior to that other methods can adjust the parameters of the query in a nice, chainable way.
[20:18:54] <GothAlice> koboldthegreat: One of the route registrations you have added is badly formatted in some way.
[20:19:09] <StephenLynx> yeah, I really thought it was inconvenient to have to run callback from callback from callback
[20:19:38] <koboldthegreat> k i will have a look
[20:19:41] <GothAlice> koboldthegreat: (Controller routes.)
[20:19:41] <StephenLynx> so you can just do a find().sort().limit().toArray instead of using an aggregate and still keeping it using just a single callback?
[20:19:55] <GothAlice> That _should_ be one callback.
[20:19:59] <GothAlice> (On toArray.)
[20:20:14] <GothAlice> In non-async drivers that'd return rather than taking a callback.
[20:20:37] <StephenLynx> will make sure of that. the main reason I used aggregate for everything is that I thought I would have to use one callback for each operation.
[20:20:48] <GothAlice> (In a similar way that find().sort().limit().forEach(callback) is a single callback.)
[20:21:13] <GothAlice> find() returns a cursor. .sort() returns a new, mutated copy of that cursor. .limit() repeats this.
[20:21:31] <GothAlice> Only actual iteration (forEach, toArray, etc.) will execute the query defined by that cursor object.
[20:22:15] <StephenLynx> doesn't find also accepts an callback that yields the cursor, though?
[20:22:23] <GothAlice> Also: it's important to stress that these chain methods (sort, limit, etc.) return _copies_. They _do not_ modify the original. This makes partial chaining and conditional chaining a viable thing.
[20:23:30] <StephenLynx> nah, I use the official driver, I am pretty sure it allows for that, checking my last project right now.
[20:24:01] <StephenLynx> https://gitlab.com/hub1dev/hub1/blob/master/src/be/boot.js#L352 ye
[20:24:11] <StephenLynx> I thought that this was the only option :v
[20:24:22] <godzirra> StephenLynx: But if I remove the dateCreated section, it works fine.
[20:24:39] <godzirra> StephenLynx: It's literally just teh dateCreated section that I add that breaks it. I can only assume i'm setting up dates wrong or something?
[20:24:47] <GothAlice> StephenLynx: http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find You're not using the official driver, you're using an async fork.
[20:25:03] <GothAlice> :P
[20:25:14] <StephenLynx> wait, wait
[20:25:22] <StephenLynx> I am using the mongodb module.
[20:25:33] <godzirra> I just verified. If I remove lines 22-25, I get results.
[20:25:33] <StephenLynx> "npm install mongodb"
[20:25:53] <StephenLynx> http://mongodb.github.io/node-mongodb-native/2.0/ right here.
[20:26:32] <StephenLynx> I am starting to think the find is just flexible.
[20:26:55] <StephenLynx> and the documentation fails to inform you can use the callback so just informs the returning cursor.
[20:27:07] <GothAlice> Well, yes and no.
[20:27:19] <godzirra> I suppose so? I just need to know how I'm failing at adding the dateCreated line.
[20:27:20] <GothAlice> findOne* methods obviously terminate the expression, those have documented callbacks.
[20:27:27] <StephenLynx> indeed.
[20:27:29] <godzirra> Because I don't understand. :/
[20:27:30] <GothAlice> find() explicitly does _not_ terminate the expression, thus no callback.
[20:28:11] <StephenLynx> well, I am using the very module that doesn't specify the callback on its documentation.
[20:28:12] <StephenLynx> "mongodb": "latest"
[20:28:45] <GothAlice> StephenLynx: Then you're doing it wrong and should fix your code to not use a callback on find(). As you noticed, the entire concept of having a callback there is kinda silly, since find() returns the cursor anyway.
[20:28:57] <StephenLynx> I can understand that.
[20:29:11] <GothAlice> No wonder you wanted to avoid it. ;)
[20:29:16] <StephenLynx> the point is that the code is working despite the documentation not specifying you can use a callback.
[20:29:46] <GothAlice> Undocumented features should not be relied upon. There is no promise that it'll work in any future (or past, for that matter) version.
[20:30:06] <StephenLynx> agreed.
[20:30:21] <StephenLynx> I wouldn't expect for someone to screw up on its docs though.
[20:30:42] <StephenLynx> its been an exemplar documentation so far.
[20:30:58] <godzirra> I updated my gist to show what works in the mongodb console vs what doesn't work in my node.js code.
[20:31:01] <StephenLynx> godzirra run a find, print all and show me the values you get.
[20:31:27] <godzirra> StephenLynx: In the console, with the dates?
[20:31:32] <StephenLynx> yes.
[20:31:44] <StephenLynx> and use pretty() in the end.
[20:32:17] <StephenLynx> also print what startDate is before the query.
[20:34:17] <godzirra> StephenLynx: https://gist.github.com/slooker/0417d60841c2f70c99d7 Line 26 is the data. this is in the mongo console. Line 10 is the results of console logging the start date.
[20:35:15] <StephenLynx> probably its because you are using a string to query
[20:35:21] <StephenLynx> when it has a date object saved
[20:35:35] <StephenLynx> besides
[20:35:57] <StephenLynx> I don't see a field dateCreated on your docs, is that how you query for the creation date on the _id? I am not familiar with it.
[20:36:34] <StephenLynx> keep in mind you use actual objects when in the console
[20:36:43] <StephenLynx> that is probably why it works there.
[20:37:02] <StephenLynx> if you remove that call to toISOString it will probably work.
[20:37:29] <StephenLynx> and you are using "dateReported" on the console and "dateCreated" on the application.
[20:37:50] <StephenLynx> yeah, probably these are the two errors.
[20:40:25] <godzirra> Crap.
[20:40:28] <godzirra> It's dateReported.
[20:40:28] <godzirra> Sifgh.
[20:41:28] <godzirra> StephenLynx: thanks, that was it. It was the toISOString.
[20:41:33] <godzirra> It's always something trivial.
[20:41:36] <StephenLynx> heh
[20:41:43] <StephenLynx> I had a similar issue once, with types.
[20:41:50] <StephenLynx> ints vs strings
[20:41:57] <godzirra> Yeah, I did too, but that one I caught early.
[20:42:11] <StephenLynx> besides I have this one habit
[20:42:19] <StephenLynx> I always save dates as strings.
[20:43:11] <StephenLynx> usually as yyyy-MM-dd HH:mm:ss
[20:43:22] <StephenLynx> yyyy-MM-dd_HH:mm:ss actually
[20:49:06] <godzirra> StephenLynx: Asl ong as you have a standard you can work with, i don't think that's bad.
[20:49:24] <StephenLynx> yeah, I generate them using a single function in the project.
[20:49:31] <StephenLynx> and the format is in the docs.
[20:49:36] <godzirra> All good things.
[20:49:46] <StephenLynx> I do that for readability.
[20:49:56] <StephenLynx> I don't know about performance.
[20:55:15] <GothAlice> Storing dates as strings loses the ability to use date projections. But StephenLynx isn't here right now. XP
[20:55:30] <GothAlice> Also… why not the ISO format? >_<
[20:58:11] <GothAlice> Also… it wastes (takes an additional) 15 bytes for each date using his format.
[21:07:27] <okanck> hello, have a sharded server which is set up. when i wanna sort the query answers so slow. even on indexed columns.
[21:07:34] <okanck> query explain : http://pastebin.com/3ngvGFRg
[21:07:56] <okanck> what am I doing wrong ?
[21:08:58] <okanck> my query is: db.column.find({"PlayerID":2}).limit(100).sort({"Time":-1}).explain();
[21:10:08] <okanck> indexes, "Time" : -1 & "PlayerID":1
[21:20:48] <joannac> okanck: create a compound index
[21:22:51] <okanck> i must define like {Time:-1, PlayerID:1} ?
[21:23:05] <joannac> wrong way around
[21:24:22] <okanck> i will reserch joannac. thanks
[22:13:03] <grazfather> is there a way to upsert where the spec for the search is written without having to rewrite? e.g. db.test.update({"ip":1,"host":2},{"field":"test"}, upsert=true) but the result contains ip 1 host 2 in addition to the field:test?
[22:23:28] <grazfather> I guess I could do $setOnInsert: <ref to spec>
[22:26:30] <joannac> grazfather: http://docs.mongodb.org/manual/reference/method/db.collection.update/#upsert-behavior
[22:27:51] <grazfather> oh then $set should ahve done it
[22:28:00] <grazfather> i was just lazy on mongo repl testing
[22:28:34] <grazfather> Yeah damn i should not have cut corners. Thanks a lot
[23:31:59] <sabrehagen> Derick: /etc/mongodb.conf only specifies bind_ip as 127.0.0.1 in mongodb 3 install. is --bind_ip 0.0.0.0 persistent?
[23:32:36] <GothAlice> sabrehagen: Command-line arguments override configuration files.
[23:32:47] <GothAlice> sabrehagen: As long as that command-line option is present, it'll "persist".
[23:34:12] <sabrehagen> GothAlice: i'm using mongodb as a service so i'm not sure how to supply a command line parameter
[23:34:42] <GothAlice> A-ha.
[23:35:33] <GothAlice> If you're using a service, how do you ordinarily connect? It must be listening openly to accept connections…
[23:51:33] <sabrehagen> via mongo at the terminal on the box
[23:52:16] <sabrehagen> as mentioned before, mongodb.conf has localhost listening by default so this is how i'm connecting on a fresh install