PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 13th of July, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:00:03] <dimon222> yeah might take awhile for sync :o
[00:51:28] <sabrehagen> i have a settings document that stores only booleans. rather than reading the contents of the document, is there a more performant db call that checks if a given boolean is true?
[00:53:24] <StephenLynx> field:value
[00:53:29] <StephenLynx> isX:true
[00:54:03] <StephenLynx> using a single array that holds strings might work too and its a little more flexible.
[01:09:35] <jglover> hey guys, new to Mongo. Does querying on many embedded documents slow down a query considerably?
[01:10:01] <jglover> what things particularly (if this is not too broad of question) do slow down a mongodb query?
[01:10:42] <jglover> ooo just found mongo has explain. disregard.
[01:25:41] <jglover> lets say I want to track attendances to a conference. I have two documents, Conference, ConferenceAttendance. a Conference has a key, conference_attendances, which is an array of type ConferenceAttendance. Now, lets say I want to query on the first person to attend the conference. Should I make a special key, first_attendance, that holds a conference attendance, or should I query directly on the first element of the conference_attendances a
[04:44:10] <Havalx> dimon222: reinstalling did not work.
[04:44:34] <Havalx> ERR: SyntaxError: Non-ASCII character '\xcf' in file ./mongod on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
[08:17:20] <frankS2> Hi, How can I get mongodump installed on a system with mongodb-org-server installed?
[11:03:51] <iszak> If I run mongodump on a replica set will it block reads or writes?
[11:10:55] <cheeser> yes
[11:44:32] <dimon222> hm, really? i dont see that in docs - http://docs.mongodb.org/manual/reference/program/mongodump/
[12:01:21] <iszak> dimon222: maybe this part "Changed in version 2.2: When used in combination with fsync or db.fsyncLock(), mongod will block reads, including those from mongodump, when queued write operation waits behind the fsync lock. Do not use mongodump with db.fsyncLock()."
[12:02:57] <dimon222> yeah but fsync is a different case i assume
[12:04:09] <dimon222> actually fsync happens every 60 seconds, so prolly...
[13:05:36] <johnflux> I'm trying to work out if mongodb is a good fit for what I'm doing
[13:07:06] <johnflux> I have 300GB of json files, and I want to ask queries like: list all the entries for a given userid before a given time
[13:07:50] <cheeser> sure
[13:09:08] <deathanchor> johnflux: if you want compression (so the DB takes up less space) you can use tokumx but there are some slight differences in behavior with that and mongodb
[13:09:14] <deathanchor> but they basically work the same
[13:10:34] <cheeser> or use wiredtiger as your storage engine
[13:12:52] <johnflux> when I import the data,can I choose which fields to use? And also specify if a field is to be treated as a date?
[13:13:06] <cheeser> depends on the importer
[13:13:22] <johnflux> hmm, I'm looking at examples online that do things like: mongoimport -d test -c example data.json
[13:13:36] <cheeser> mongoimport --help shows some options for selecting fields
[13:13:49] <deathanchor> yeah, I'd import it all and sort it out later :D
[13:14:05] <johnflux> deathanchor: well, that could take a few days
[13:14:07] <johnflux> 300GB...
[13:14:08] <deathanchor> or do a subset of data (like first 1000 rows)
[13:14:17] <deathanchor> then play with that
[13:14:37] <cheeser> ah. "If you attempt to include --fields when importing JSON data, mongoimport will return an error. --fields is only for csv or tsv imports."
[13:14:38] <johnflux> and then create the indexes after I've imported?
[13:15:10] <johnflux> (I'm coming from a sql background. I do create indexes right?)
[13:15:17] <deathanchor> johnflux: depends if you want to build the index while importing or after it is all done
[13:15:32] <johnflux> deathanchor: should I care which?
[13:15:45] <deathanchor> johnflux: faster import if it doesn't have to do index building while importing
[13:17:35] <deathanchor> also if you do mongoimport with --dbpath, I find that faster, but requires that mongod not be running
[13:17:57] <deathanchor> I'd do that for the big import
[14:26:34] <johnflux> I have file different json files to import. Do I want to put these in different collections or in different databases?
[14:27:13] <johnflux> (I know it's an open ended question, but I don't know how to determine which I should use)
[14:46:10] <dbclk> for a cluster setup
[14:46:23] <dbclk> does mongo has a habit of opening repeated sockets?
[14:48:14] <cheeser> ?
[14:50:50] <dbclk> meaning I have mongo instances setup a different geographical locations
[14:51:13] <dbclk> the primary box is trying to establish connections with the on at a co location
[14:51:22] <dbclk> to be it seems it's opening a lot of sockets
[14:51:54] <cheeser> what is "a lot"?
[14:53:40] <dbclk> meaning it exhaust alll sockets
[14:53:53] <dbclk> I'm not sure how many sockets it's opening but, from the mongo.log
[14:53:55] <dbclk> I'm seeing a lot
[14:55:21] <cheeser> that sounds like a error then, yeah.
[14:56:45] <dbclk> yeah but, I haven't configured mongo to use geographical setup
[14:56:58] <dbclk> I think their is a recommended setup for such architecture
[14:57:07] <dbclk> is there a way I can check how many sockets mongo has opened?
[14:57:33] <cheeser> i dunno about that one
[15:06:45] <fontanon> Hi everybody! What does this means? "moveChunk failed to engage TO-shard in the data transfer: can't accept new chunks because there are still 1 deletes from previous migration"
[15:07:35] <fontanon> Is there anyway to see which was the chunk pending for deletion?
[15:27:29] <johnflux> I'm doing: db.actionlaunch.distinct("appVersion") to get a list of unique values for appVersion
[15:27:36] <johnflux> how can I get a count for each of these?
[15:27:43] <cheeser> .count()
[15:29:03] <johnflux> cheeser: how? I did look at that, but didn't see how
[15:29:13] <cheeser> db.actionlaunch.distinct("appVersion").count()
[15:29:54] <johnflux> cheeser: "... has no method 'count'"
[15:30:11] <johnflux> cheeser: I guess you mean "length" but this counts the number of unique values
[15:30:13] <cheeser> hrm. what type comes back? should be a cursor.
[15:30:50] <johnflux> cheeser: distinct returns an Object
[15:31:02] <johnflux> a list
[15:32:00] <cheeser> ah. weird. what's wrong with .length then?
[15:32:25] <johnflux> cheeser: it returns the number of appVersions that I have. i.e. it returns just "19"
[15:32:52] <johnflux> What I was after was something like: appVersion: "1.1.27-Beta", count: 5
[15:32:55] <cheeser> oh! you want, for each value, the number of occurrences.
[15:32:58] <johnflux> right!
[15:33:03] <cheeser> got it.
[15:33:12] <johnflux> I think I want aggregate
[15:33:20] <cheeser> you'll want an aggregation probably with $group and a count
[17:29:25] <symbol> I've read that if you have two sets of data that are related and immediate consistency is needed that references should be done instead of embedding...In the example of a user with an address for an e-commerce site, it seems that the address is something that eventual consistency wouldn't satisfy.
[17:29:38] <symbol> At the same time, I don't expect a user's address to change very often.
[18:03:17] <johnflux> I'm using db.collection.aggregate() and it produces output like { "_id" : "red", "number": 4 } { "_id" : "green", "number": 3 }
[18:03:28] <johnflux> How can I now sum up all the numbers, producing a final count?
[18:03:50] <johnflux> I'm also confsued what the type is. Is this is a list of dicts?
[18:03:58] <johnflux> typeof just says that it's an object (?)
[18:04:33] <symbol> johnflux: Have you checked out http://docs.mongodb.org/manual/reference/operator/aggregation/add/#add-numbers?
[18:08:44] <johnflux> symbol: I'm using $group but what can i put for the _id?
[18:21:52] <sicksince> Hi there can someone help me find some mongo documents, here is an example, I need to select based on birthday day and month,
[18:21:55] <sicksince> http://pastebin.com/VEhMAXWE
[18:32:36] <sicksince> db.customers.find({dates: {$elemMatch: {selected: 'Birthday', fields: {$elemMatch: {id: 'day', value: 24 } } } } }).pretty()
[18:32:40] <sicksince> this doesn't work.
[21:33:51] <johnflux> I have:
[21:34:10] <johnflux> db.actionlaunch.aggregate(
[21:34:12] <johnflux> { $group : { _id : { "appVersion" : "$appVersion", "token" : "$token" }, number : { $sum : 1 } } },
[21:34:13] <johnflux> { $group : { _id : "$_id.appVersion", number : { $sum : 1 } } },
[21:34:15] <johnflux> { $group : { _id : 0, number : { $sum : "$number" } } }
[21:34:16] <johnflux> );
[21:34:18] <johnflux> can I split this into two commands?
[21:34:31] <johnflux> so that I do the first two $group commands first
[21:34:36] <johnflux> put that in a variable
[21:34:41] <johnflux> then do the second command?
[21:35:19] <johnflux> do I have to save it to a collection if I want to do that?
[21:39:18] <johnflux> (the third line is just for sanity checking)
[21:47:02] <johnflux> if I do:
[21:47:12] <johnflux> var a = db.actionlaunch.aggregate(...)
[21:47:23] <johnflux> then do just:
[21:47:25] <johnflux> a
[21:47:28] <johnflux> it prints out the result
[21:47:32] <johnflux> but if I do again:
[21:47:33] <johnflux> a
[21:47:35] <johnflux> then it prints nothing!
[21:47:46] <johnflux> why does a get cleared by just displaying it?
[22:03:10] <Havalx> I fixed the concern.
[22:55:28] <Havalx> How does mongodb compare to relational databases such as mysql and sqlite?
[22:55:57] <Havalx> I spent time reviewing the available case studies of the technology.
[22:56:37] <Havalx> are there specific examples or forms of data that would make use of one options over another?
[22:57:14] <Havalx> ahr3n: Hi.
[22:59:25] <StephenLynx> if you don't need relational integrity, transations or joins and need better performance, especially with large data bases, mongo is a better choise.
[23:00:02] <StephenLynx> sqlite is not a database, but a library to be used by the application to better store data without the help of a database.
[23:01:53] <Havalx> StephenLynx: what if I needed to store for example; comments, a status post, or like feature?
[23:02:32] <StephenLynx> it depends on how you are going to query the data.
[23:02:55] <StephenLynx> if you don't know what kind of tools you need for your application, I suggest you use mariadb.