PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 16th of August, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:00:04] <joannac> no problem, sorry it took some time
[00:00:53] <faeronsayn> @joannac, as long as it worked I should be saying sorry for wasting so much of your time.
[00:01:07] <faeronsayn> I do have a small question, whats the command to delete a collection in mongo?
[00:01:29] <joannac> db.collectionname.drop()
[00:02:45] <faeronsayn> so if collection is "weird" i'd just do db.weird.drop(); ?
[00:03:11] <joannac> yup
[00:03:34] <faeronsayn> okay awesome
[00:04:04] <faeronsayn> how to show all the collections?
[00:04:33] <joannac> show collections
[00:05:04] <faeronsayn> system.indexes is something mongo related?
[00:05:35] <joannac> yes, that's the list of all the indexes in that database
[00:06:33] <faeronsayn> oh okay
[00:14:12] <faeronsayn> @joannac is it possible to add fields to all documents with a default value?
[00:25:11] <joannac> faeronsayn: you mean, right now?
[00:25:14] <joannac> or in general
[00:25:36] <faeronsayn> in general I'd say
[00:25:43] <joannac> $setOnInsert
[00:28:20] <faeronsayn> @joannac, is it better for a string type to be set to an empty string or a null value? Does it make a difference (performance,convention?)
[00:37:15] <renegadeds> Hey all, I'm just wondering, does anyone know why when I install mongoDB 2.6.4 on 64bit windows I get the error: "Key not valid for use in specified state"?
[00:37:25] <renegadeds> I'm running windows 7 64-bit
[10:27:05] <antoinet> Hello, I'm trying to create a text index for a nested data structure and I run into an "Index key pattern too large error" with code 67
[10:27:42] <antoinet> db.ranking.ensureIndex( { "keyword": "text", "rankings.results.1.domain" : "text", "rankings.results.2.domain" : "text", ... ... "rankings.results.99.domain" : "text", "rankings.results.100.domain" : "text" }
[10:28:04] <antoinet> http://stackoverflow.com/questions/25336130/mongodb-multiple-text-index-index-key-pattern-too-large-error-code-67
[10:33:44] <kali> waw
[10:34:35] <kali> honestly i'm not surprised
[10:35:07] <antoinet> what do you mean?
[10:35:59] <kali> well, your document structure is not exactly what mongodb is designed for
[10:38:52] <antoinet> yes, you refer to the nested dict structure instead of an array?
[10:39:58] <kali> yes
[10:40:30] <kali> antoinet: you can index all fields with $**, that may be easuer
[10:41:48] <kali> (just reading from the doc, i've never used mongodb text inde)x
[10:42:17] <antoinet> kali: yes I tried that but I only want to index the keyword and base_domain
[10:42:54] <antoinet> what if I changed the structure from results: {"1" : { "domain" : "example1.com", "href" : "http://www.example1.com/"}, … “99” : { "domain" : "example99.com", "href" : "http://www.example99.com/“}}
[10:43:34] <antoinet> to results: [{"domain" : "example1.com", "href" : "http://www.example1.com/"}, … { "domain" : "example99.com", "href" : "http://www.example99.com/“}]
[10:43:46] <kali> it would probably be better
[10:44:15] <kali> i'm not sure about text index, but a lot of thing would be easier
[10:45:14] <kali> antoinet: it might be worth adding a "rank" property in your result subdoc, to replace the key. it may make your life easier at later stages
[10:45:57] <kali> antoinet: the thumbrule is, never use a variable value as a key. only name and keywords
[10:46:42] <antoinet> kali: I agree, but I receive this json from an external API
[10:47:30] <kali> antoinet: mongodb will be next to useless if you stick to this schema. everything will be awkward and complicated
[10:49:18] <antoinet> kali: okay, I'll modify it then and introduce the rank, something like that? results: [{"rank" : "1", "domain" : "example1.com", "href" : "http://www.example1.com/"}, … { "rank" : "99", "domain" : "example99.com", "href" : "http://www.example99.com/“}]
[10:50:43] <kali> looks good
[10:52:58] <antoinet> kali: but then the index would be the following? > db.ranking.ensureIndex("keyword": "text", "rankings.results.domain")
[10:53:35] <antoinet> kali: db.ranking.ensureIndex("keyword": "text", "rankings.results.domain" : "text")
[10:56:16] <kali> antoinet: yes
[10:56:44] <kali> antoinet: with the same remark: i have no experience using text indexes.
[10:58:21] <antoinet> kali: okay, I'll try that and see how it goes, thanks
[11:01:31] <antoinet> kali: Just a question, why do you say that "your document structure is not exactly what mongodb is designed for"?
[11:01:49] <kali> 12:41 < kali> antoinet: the thumbrule is, never use a variable value as a key. only name and keywords
[11:03:10] <antoinet> kali: Ok!
[13:39:04] <dexterity> How do I get versioned data when using mongoengine?
[13:39:28] <dexterity> I've used sqlalchemy before and it's relatively easy there.
[14:03:05] <jakemongo> Hey - anyone around?
[14:03:43] <jakemongo> I'm currently working on a (!) messaging app and I'm trying to write a 'load older messages' function
[14:04:31] <jakemongo> there are private & group messages on my site, and I can get timestamps based upon the msg's ObjectIds
[14:05:27] <jakemongo> I'm just wondering if someone could suggest the best way to write a compound query that finds messages older than X
[14:05:45] <jakemongo> based upon the Is
[14:05:46] <jakemongo> d
[14:10:33] <jakemongo_> Got disconnected - anyway, if anyone is around at the moment let me know :) cheers
[18:56:06] <faeronsayn_> Anyone here atm?
[21:34:33] <noir_> hi guys, i'm learning mongodb and i'm trying batch insertions. i've not found so much in the documentation, but i have been suggested not to use the bulk operator. i need to use batch insert to make multiple insert with 1 query
[21:34:39] <noir_> any hint on how to accomplish this?
[21:52:34] <faeronsayn_> anyone here?
[21:52:58] <noir_> yeah
[21:53:40] <noir_> i have a problem... You only have two data centers available. Which arrangement(s) of servers will allow you to be stay up (as in, still able to elect a primary) in the event of a failure of either data center (but not both at once)?
[21:53:49] <noir_> 1) 3 server in data center 1
[21:53:59] <noir_> 2) 2 server in dc 1, 1 server in dc 2
[21:54:03] <noir_> 3) none of above
[22:07:06] <MongoNewb> Hey all, very new to Mongo and had a quick question. I have a database with each entry in a collection being a dictionary of a bunch of pairs, "ID":"weouigfhswduohgwuiohgweuhweru", "name: Jose", etc., how can I search for all entries where name = "jose"?
[22:10:20] <faeronsayn_> @MongoNewb
[22:10:25] <faeronsayn_> use find I believe
[22:10:37] <faeronsayn_> Collection.find({name: 'myname'});
[22:17:31] <MongoNewb> ok I forgot to put the {} in there, I just had find(name:'name'). thank you
[22:54:11] <faeronsayn_> http://stackoverflow.com/questions/25344444/best-model-for-representing-many-to-many-relationships-with-attributes-in-mongod
[22:59:11] <MongoNewb> Ok so now I found all of the collections where name = "name" that I wanted, it has another dictionary within that called statistics_list, how do I pull out the statistics_list from each entry?
[23:30:14] <DrIDK> hello, how can serialize BSON to real JSON. I mean, have "id" key instead "_id". Same question for date and other format supported by bson
[23:40:38] <huleo> http://docs.mongodb.org/manual/reference/program/bsondump/