PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 13th of January, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:31:28] <sqwishy> If I pass raw user input as filters for the find method, is there a way they can exploit the $where operator or something to do nasty things?
[02:29:23] <BobFunk> trying to add a new member to a replica set, but can't get it to sync
[02:29:27] <BobFunk> keep getting: initial sync exception: 10089 can't remove from a capped collection 5 attempts remaining
[03:01:30] <skooperdoo> hello
[03:04:10] <skooperdoo> i am having problems with a 'simple' mongodb query in python, I am a bit of a noob with both
[03:04:24] <skooperdoo> is there any simple examples to get me going?
[03:05:19] <skooperdoo> inserting is a breeze, as soon as i find or find_one nothing seems to work
[03:14:17] <skooperdoo> so.. whats new?
[03:59:34] <skooperdoo> my request is like this... half=collection.find({'name':'simon'})
[04:00:21] <skooperdoo> from python i can print half.count(), when i try print half['name'] i get TypeError: 'NoneType' object is not callable
[04:00:25] <skooperdoo> what am i doing wrong?
[15:29:22] <Deathspike> I am experimenting to use MongoDB instead of SQL for a production website. I could use some information regarding mapping of data. I understand that everything is essentially a document and lookup is to be avoided, but how do I do searches based on partial text (searching titles of TV series, for example) and how can I efficiently create a genres search (i.e. each document has an array with genres, should I add references of each
[15:29:22] <Deathspike> document id to a different collection with that genre name to quickly be able to search?). Help is appreciated.
[15:31:24] <kali> for full text, there is nothing like a full text engine
[15:31:55] <ron> or just plain reading.
[15:31:56] <kali> for tags, an array of string or ids with in index works perfectly
[15:31:59] <ron> with a good memory.
[15:32:50] <Deathspike> kali: Would it be acceptable to store names of genres in the actual documents and searching through that, or is it much faster to have a dedicated array with all references to see if it is contained (Assuming the latter for performance)?
[15:33:22] <kali> it would not make a big difference
[15:34:25] <Deathspike> That keeps it easier.
[15:35:00] <Deathspike> And regarding title searches, is there anything remotely similar to calculating the Levenshtein distance for approximate matching?
[15:35:10] <Deathspike> Or, in SQL-terms, LIKE '%something%'?
[15:36:35] <kali> Deathspike: you can use regexp. but for %something% you'll be O(n)
[15:38:28] <Deathspike> kali: Would you have a recommendation on how to solve this particular issue?
[15:39:10] <kali> Deathspike: use a full text engine
[15:41:05] <Deathspike> kali: Seeing as I have little experience with full text engines, is there a 'recommended' one to pair with MongoDB for easier integration?
[15:41:55] <kali> Deathspike: you'll basically have to do everything on tha app side, so mongodb does not make a big difference. popular choices are solr and elasticsearc
[15:41:58] <kali> h
[15:43:15] <Deathspike> kali: Ah I was under the impression it was possible to have changes in MongoDB be automatically replicated into a search engine and that there might be readily available packages to do that for you. Thanks for the information. :)
[15:48:20] <kali> Deathspike: some data access layer may help you with that... i called them ODM last time, but i was made to understand it was pedantic. so look at your ORM layer
[15:58:02] <wereHamster> OML, Object Magic Layer
[17:14:35] <Aartsie> hi guys
[17:15:31] <Aartsie> can someone help me with mongoose (node.js driver for mongodb) ?
[17:18:54] <kali> Aartsie: you'd better ask
[17:20:56] <Aartsie> how can i get the information from docs ? https://gist.github.com/9fdd914cbefda24b734f i have try to put it in an array, object and string but it looks that i have no acces to the find({}, function(err, docs){ }); scoop
[17:20:57] <Aartsie> https://gist.github.com/9fdd914cbefda24b734f
[17:30:13] <Aartsie> anyone an idea ?
[17:37:44] <wereHamster> Aartsie: you are confused about how nodejs asynchronous programing works
[17:37:51] <wereHamster> line 8 will return undefined
[17:37:58] <wereHamster> because the callback has not been executed yet
[17:39:12] <Aartsie> wereHamster: hmm how can i fix that ?
[17:40:18] <wereHamster> https://gist.github.com/2dfc0ade594600b568a0
[17:42:19] <Aartsie> wereHamster: how can i use fn ? srry i'm just learning node
[17:42:46] <wereHamster> Aartsie: there are better resources if you're learnign nodejs than this channel
[17:52:29] <Aartsie> wereHamster: Can you give me an good recource ?
[18:56:27] <dreinull> someone here who can help me with a simple query using the ruby gem?
[18:56:47] <kali> just ask
[18:57:14] <dreinull> I need to get all ids from a database in one query
[18:57:20] <dreinull> nothing else
[18:57:43] <dreinull> I have 25k entries and using mongomapper for that is slow
[18:58:05] <kali> .find({}, :fields => %w(_id))
[18:58:16] <dreinull> or cool, thanks.
[18:58:49] <owen1> let's say i have 3 hosts in my replica set. 1 can't see the other two. will he become a primary? what if the other 2 are ok, it's just a network issue?
[18:59:07] <dreinull> would it be possible to build a string on the mongo server before it returns the id? These ids are going to be urls for a sitemap and if mongo could do that for me the costs would even be cheaper
[19:00:47] <kali> owen1: 1 out of 3 will not becomes primary, it can not get a majority
[19:01:28] <kali> owen1: if the primary was one of the two still seeing each other, it will stay primary
[19:03:31] <switz> http://stackoverflow.com/questions/14306931/shorten-mongodb-id-in-node-js
[19:04:34] <owen1> kali: ok. and what happened if only 2 are alive and the primary dies?
[19:09:09] <kali> owen1: they elect a primary among them
[19:10:50] <owen1> kali: got it
[19:23:03] <aep> can i tunnel mongo through https? the default db security only supports password auth. i'd rather not expose that to the internet