PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 3rd of August, 2017

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:31:19] <sector_0> are there any performance downsides to putting $project before $match in an aggregate?
[02:00:27] <hehehe> hi
[02:00:46] <hehehe> whats the quick way to find a text string in DB?
[02:00:49] <hehehe> and see where is it
[02:00:50] <hehehe> :D
[10:17:15] <jrtappers> I'm using the mongo/db/audit.cpp hooks for a research project, but I seem to get 2 calls to logAuthentication, I think I have missed something, because I see 2 login attempts, is there one per database?
[10:17:48] <jrtappers> Because that is the only way I can explain the double login events
[12:13:54] <zealsham_> what is best metho to show realtionship in mongodb
[12:14:28] <DeltaHeavy> Hey, so I often see in other rooms MongoDB gets a lot of hate when it's used where an RDBMS could be used. When I see MongoDBs marketing videos, it sort of backs up the whole "baseless hype" in my mind (https://www.youtube.com/watch?v=CvIr-2lMLsk). Articles like this are fairly in-line with what I think http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/. Interesting in hearing some opposing viewpoints
[12:14:38] <DeltaHeavy> Interested in hearing*
[12:17:28] <zealsham_> DeltaHeavy: yes i am
[12:19:42] <DeltaHeavy> zealsham_: You are what? I was asking for opposing viewpoints, unless you're asking me to state why I currently have the opinion of RDBMSs being preferred over MongoDB for most generic CRUD app use cases.
[12:21:09] <zealsham_> DeltaHeavy: i read the articles . i dont k now mysql properly . and modeling databases with RDBMS is hard . performing those joins and data normalization is quite hard for a newbie to an extend
[12:23:07] <DeltaHeavy> I agree, that is something I think MongoDB is good for, a low learning curve. I think that might turn around and bite you in the ass though later on.
[12:23:18] <DeltaHeavy> I don't hold these views strongly, I've never used MongoDB extensivly
[12:42:33] <hehehe> hi
[12:42:42] <hehehe> whats the easy way to find a text string in db?
[12:42:50] <hehehe> and then find and replace with another text string
[12:42:59] <hehehe> Derick:
[12:48:50] <hehehe> mongo back end documentation sucks ass
[12:48:53] <hehehe> big time
[12:48:53] <hehehe> :D
[12:49:00] <hehehe> who can write normal docs
[12:49:00] <hehehe> :D
[13:26:06] <Derick> hehehe: "find a text string" - you need to be more specific.
[13:26:45] <Derick> zealsham_: MongoDB does not do relations between documents in your traditional SQL Foreign Key way
[13:27:30] <Derick> DeltaHeavy: IMO, most of the "MongoDB sucks" articles, are in the form of that 2013 article you linked. In most cases, it is people using technology for the wrong reasons, or while not understanding it properly.
[13:28:11] <zealsham_> Derick: derrick i understand that it uses either the refrence method or the embedding method.
[13:28:11] <Derick> hehehe: and also, trashing the work of my coworkers will not gain you brownie points.
[13:28:23] <Derick> zealsham_: OK - then, what is the question? :)
[13:28:50] <zealsham_> Derick: how to do that properly in other to avoid data duplication
[13:29:56] <DeltaHeavy> Derick: I do think MongoDB has it's uses but I almost always see people trying to use it as "MySQL/PostgreSQL but easy~~~". Would you agree it's not a good idea to use it in place of an RDBMS like that and use it for specific use cases?
[13:31:02] <Derick> zealsham_: you should not be scared duplicating data
[13:31:25] <Derick> DeltaHeavy: In many many cases, it is as good (if not better) for CRUD like apps than MySQL
[13:31:36] <Derick> but there are a few cases where you just really need a RDBMS
[13:31:37] <zealsham_> Derick: isn"t that bad
[13:32:00] <Derick> that said, DeltaHeavy, you do need to use MongoDB *correctly* and think about how to design your schema
[13:32:46] <Derick> zealsham_: You need to let go of RDBMS design tactics. Unlike an RDBMS, with MongoDB you design you schema according to your application's needs and *not* how to store the data most optimally
[13:33:10] <zealsham_> Derick: ohh i see
[14:12:34] <hehehe> Derick: how the fuck do I find string in a db?
[14:12:35] <hehehe> lol
[14:12:42] <hehehe> I got mongo compas
[14:12:55] <hehehe> it can search but only in 1 collection
[14:13:00] <hehehe> and exact
[14:13:16] <hehehe> not sure how to get any string that matches text
[14:13:20] <hehehe> come on it may be nice DB
[14:13:29] <Derick> you need to tune down the swearing.
[14:13:36] <hehehe> but need more clear howto
[14:13:37] <Derick> Queries are only done per collection
[14:13:43] <hehehe> ,,,,,,
[14:13:44] <hehehe> why
[14:13:57] <hehehe> it would be more useful if entire DB can be searched
[14:14:01] <Derick> what why? An RDBMS doesn't allow that either
[14:14:16] <hehehe> hmmm
[14:14:28] <hehehe> with some script maybe possible
[14:14:41] <hehehe> and inside collection anyway to search for a text string?
[14:14:53] <hehehe> at i use - { "i18nLabel" : "email" }
[14:14:56] <hehehe> for example
[14:15:12] <hehehe> it only returns stuff if it matched email exactly
[14:16:01] <Derick> right, that is a normal equality match
[14:16:09] <hehehe> yes
[14:16:29] <hehehe> how do I match anything that cointain enmail
[14:16:31] <hehehe> email
[14:16:40] <hehehe> like Emalblala useremail
[14:16:41] <hehehe> and so on
[14:17:29] <hehehe> and what if I want to search across all ids in collection?
[14:17:32] <Derick> You can use the text search index, but that is really meant for normal English words
[14:17:42] <Derick> you will need to run one query per collection in any case
[14:17:50] <hehehe> it is an english word
[14:18:07] <hehehe> my plan is to find a specific text in collection
[14:18:16] <hehehe> there are way too many documents there to check manually
[14:18:44] <hehehe> per collection ik
[14:18:45] <hehehe> ok
[14:18:59] <hehehe> how I can check if anything in collection got anything with email?
[14:19:01] <hehehe> or Email
[14:19:06] <hehehe> or emailis good
[14:19:30] <Derick> hehehe: slow down. You don't need to press enter every second.
[14:19:31] <hehehe> i want filter part to encompass all ids
[14:19:42] <Derick> https://docs.mongodb.com/manual/text-search/ « read that
[14:20:01] <hehehe> I strongly dislike mongodb manuals
[14:20:03] <hehehe> !!!
[14:20:03] <hehehe> :D
[14:20:16] <hehehe> however ok
[14:21:48] <Derick> they require you to read something.
[14:21:56] <Derick> It's all there, but it takes effort.
[14:22:41] <hehehe> yes
[14:22:50] <hehehe> becouse they can be written better
[14:22:58] <hehehe> it is possible to understand with many many re reads :D
[14:24:14] <hehehe> { "text" : "email" }
[14:24:17] <hehehe> does not work
[14:24:30] <Derick> I do not believe you read the whole document.
[14:24:42] <hehehe> I did 10 times!
[14:24:48] <hehehe> and I use mariadb before
[14:24:52] <hehehe> with 0 problems
[14:24:53] <hehehe> :)
[14:24:57] <hehehe> why would I lie :)
[14:25:04] <hehehe> db.stores.find( { $text: { $search: "java coffee shop" } } )
[14:25:49] <hehehe> For example, you could use the following query to find all stores containing any terms from the list “coffee”, “shop”, and “java”:
[14:26:01] <hehehe> whats that? all stores means all collections?
[14:26:11] <hehehe> but I can only search per collection at the time
[14:26:36] <hehehe> there gotta be something like search in collect across all fields to find text string -command
[14:26:42] <hehehe> collection
[14:27:01] <hehehe> like grep -l "string"
[14:27:14] <hehehe> or grep "string" lol
[14:27:33] <DeltaHeavy> Derick: Sorry, Missed your responses
[14:27:47] <hehehe> also
[14:27:48] <hehehe> o perform text search, MongoDB uses a text index and the $text operator.
[14:27:53] <hehehe> I dont have text index ....
[14:28:11] <DeltaHeavy> Derick: Would you say MongoDB is easier to screw up and can cause large headaches due to such things in your application level code than a RDBMS?
[14:28:23] <hehehe> I say yes
[14:28:34] <hehehe> well it looks mega simple
[14:28:36] <Derick> the URL I gave you explains how to do it. Please read it.
[14:28:41] <hehehe> I did read it
[14:28:46] <hehehe> I dont want to create text index
[14:28:49] <hehehe> any other ways
[14:28:56] <Derick> why do you not want to do that?
[14:29:17] <Derick> DeltaHeavy: it's possible, but then you can create big headaches with shitty RDBMS usage too
[14:29:49] <hehehe> Derick: cause why make it
[14:29:53] <hehehe> if I can do without it
[14:29:59] <hehehe> then i have extra bit I dont understand
[14:30:03] <hehehe> I rather not to add it
[14:30:04] <Derick> I just told you that you need a text index for this.
[14:30:10] <hehehe> ....
[14:30:17] <hehehe> mongodb is ---
[14:30:18] <hehehe> :D
[14:30:33] <hehehe> Derick: data is there
[14:30:44] <hehehe> so it is searchable as it is
[14:30:50] <hehehe> without any text index
[14:31:03] <Derick> hehehe: If you don't want to listen to advice, don't ask for it.
[14:31:26] <hehehe> i want solution
[14:31:33] <hehehe> that I can implement and it sensible
[14:31:35] <Derick> And I have given you one.
[14:31:39] <hehehe> ....
[14:31:47] <Derick> text search is the way how to do this in MongoDB.
[14:32:17] <hehehe> For example, you could use the following query to find all stores containing any terms from the list “coffee”, “shop”, and “java”:
[14:32:22] <hehehe> eee
[14:32:35] <hehehe> you said I can only search 1 collection
[14:32:39] <hehehe> how will this work then?
[14:32:53] <hehehe> in mongo compas there is no way to search all stores
[14:32:57] <hehehe> aka collections
[14:33:01] <hehehe> or what are stores?
[14:34:03] <hehehe> db.stores.find( { $text: { $search: "java coffee shop" } } ) - this searches for java or coffee or shop in all collections of database stores?
[14:34:25] <hehehe> or what?
[14:35:09] <Derick> "stores" is the collection in that example
[14:35:15] <hehehe> ok
[14:35:18] <hehehe> that makes sense
[14:35:20] <Derick> and yes, that query should work
[14:35:36] <Derick> (As long as you create a text index on the right fields)
[14:36:02] <hehehe> so howto could say For example, you could use the following query to find all fields in a collection stores containing any terms from the list “coffee”, “shop”, and “java”
[14:36:11] <hehehe> it search all fields right?
[14:36:20] <Derick> no, only the ones you created the text index on
[14:36:27] <hehehe> ok I need all fields
[14:36:31] <Derick> For example you can run the following in a mongo shell to allow text search over the name and description fields:
[14:36:34] <Derick> db.stores.createIndex( { name: "text", description: "text" } )
[14:36:35] <Derick> it's right there in the docs!!
[14:37:01] <hehehe> yes dude however pls read and see - they use unclear language often
[14:37:04] <hehehe> thats all
[14:37:11] <hehehe> yes i can re read their broken docs
[14:37:13] <Derick> https://docs.mongodb.com/manual/core/index-text/#create-text-index has more information on text indexes
[14:37:16] <Derick> read that too
[14:37:23] <hehehe> cool
[14:39:45] <hehehe> https://pastebin.com/R861aPrt so I need to simply list all fields there and run right?
[14:39:49] <hehehe> via mongo
[14:40:04] <Derick> read the whole document!!!! : https://docs.mongodb.com/manual/core/index-text/#create-text-index
[14:40:25] <hehehe> dude
[14:40:28] <hehehe> its not clear
[14:40:31] <hehehe> best double check
[14:40:45] <hehehe> they use illogical language sometimes
[14:40:47] <Derick> No, it is in there
[14:40:49] <hehehe> should be 100% logic
[14:40:52] <Derick> Just a few paragraphs further down
[14:40:58] <Derick> It is clear if you read the document.
[14:41:56] <hehehe> true
[14:41:57] <hehehe> db.collection.createIndex( { "$**": "text" } )
[14:42:00] <hehehe> this one
[14:42:08] <hehehe> yes this is clear
[14:48:58] <sandman13> Is there a hard and fast rule for config-servers? If I have 2 sharded cluster with 2 replica sets on each server, how many config-servers do I need?
[14:49:16] <sandman13> s/each server/each cluster
[14:50:05] <hehehe> https://pastebin.com/fQu8xWJt
[14:50:22] <Derick> sandman13: always 3
[14:51:14] <sandman13> Derick: Even for MongoDB 2.6?
[14:51:20] <hehehe> numIndexesAfter 2 means I now got 2 text indexes?
[14:51:24] <hehehe> or what
[14:54:13] <Derick> sandman13: in production: yes - although for testing I believe we allow one config server too
[14:54:31] <Derick> hehehe: there is alway san index on _id too. Run: db.collectionname.getIndexes() to see
[14:54:46] <hehehe> san index?
[14:55:02] <Derick> always an
[14:55:39] <sandman13> Derick: Config-server is a service?
[14:55:57] <sandman13> If yes, then I think we are okay
[14:56:44] <hehehe> createIndexes.numIndexesAfter
[14:56:44] <hehehe> The number of indexes at the end of the command
[14:56:54] <hehehe> > db.rocketchat.getIndexes()
[14:56:54] <hehehe> [ ]
[14:56:57] <hehehe> none
[14:57:05] <hehehe> and suppose to be 2
[14:57:06] <hehehe> and what are they?
[14:57:48] <Derick> was that the database name, or the collection name?
[14:58:15] <Derick> sandman13: Not sure what you mean by "service" ?
[14:59:03] <hehehe> database name
[14:59:11] <sandman13> Derick: mongod-config.service is running on three servers and two servers also run mongod.service. All CentOS 7
[14:59:25] <hehehe> ok indexes as per collection
[14:59:41] <hehehe> and how i can see which collections in db got indexes and what kind?
[15:00:13] <Derick> hehehe: you need to do getIndexes() for each of your collections
[15:01:11] <hehehe> need
[15:01:17] <hehehe> why
[15:01:21] <hehehe> ok
[15:02:16] <hehehe> > db.user.bson.getIndexes() returns nothing
[15:03:01] <sandman13> ?
[15:03:05] <hehehe> it should show newly created text index right?
[15:03:08] <sandman13> db.user.getIndexes()
[15:03:09] <DeltaHeavy> Derick: Do you agree that MongoDB makes it easier to not apply constraints to your data and overall doesn't do as good a job as an RDBMS assuming an RDBMS is a good fit for the job too?
[15:04:45] <hehehe> if not for rocketchat I would not touch mongo
[15:04:45] <hehehe> :)
[15:05:30] <sandman13> "I use X because of Y, I wouldn't have used it otherwise" General rule for everything I guess
[15:05:31] <hehehe> https://pastebin.com/W538faAQ
[15:05:47] <hehehe> sandman13: depends
[15:05:58] <hehehe> often yes
[15:06:19] <hehehe> but it said 1 got 2 indexes?
[15:06:22] <hehehe> and there are loads
[15:07:03] <hehehe> anyways now that text index seems to work
[15:07:38] <hehehe> when i run { "text" : "Email" } still 0 results
[15:09:34] <hehehe> ok I see I made a mistake
[15:10:11] <hehehe> rawrrrr
[15:10:12] <hehehe> :DX
[15:12:51] <hehehe> db.rocketchat_settings.createIndex( { "$**": "text" } )
[15:12:51] <hehehe> {
[15:12:51] <hehehe> "createdCollectionAutomatically" : false,
[15:13:33] <hehehe> Derick: so its already exist
[15:13:34] <inoperable> Hello everyone
[15:13:43] <hehehe> then why search yet to work! :D
[15:13:54] <Derick> DeltaHeavy: MongoDB can apply these constraints though - through validators. But you don't have to use them. Makes it more flexible, but also sometimes it means logic gets pushed to the application layer(s).
[15:13:55] <hehehe> inoperable: welcome to mad room
[15:13:59] <hehehe> how are you :)
[15:14:22] <inoperable> is there a way to query documents where a name matches one element of array in a smart way?
[15:14:42] <inoperable> i iterate each of the elements in array through find, thought that's certainly not the way
[15:15:10] <inoperable> docs mention $elemMatch but that is for fields that are an array
[15:15:21] <hehehe> Derick: how i can check what kind of fields existing collection text index have?
[15:15:38] <hehehe> and how come only Derick knows mongo here? lol
[15:15:43] <hehehe> where are da rest? :)
[15:15:47] <inoperable> and i got an array of values and want documents which field x matches one of elemets in the array
[15:16:15] <inoperable> so passing an array to query somehow?
[15:17:09] <hehehe> seems like all indexes are in it
[15:17:16] <hehehe> "name" : "$**_text",
[15:17:16] <hehehe> "ns" : "rocketchat.rocketchat_settings",
[15:17:16] <hehehe> "weights" : {
[15:18:27] <lemonlake> hey - if my mongodb server is part of a replset, how can i connect to it standalone?
[15:18:37] <inoperable> uhmmm
[15:18:37] <lemonlake> i tried connectign without ?replicaSet however its still connecting to it
[15:18:54] <inoperable> some tip maybe waht to look at?
[15:19:19] <lemonlake> do i need replication: replSet: in all secondaries too?
[15:19:21] <hehehe> lemonlake: do you use replica set on another box?
[15:19:29] <lemonlake> i have replica set on 3 boxes
[15:19:29] <hehehe> else its useless
[15:19:33] <hehehe> oki
[15:19:35] <lemonlake> and i cannot connect to their standalone databases normally
[15:19:39] <lemonlake> only to their replica databases
[15:19:50] <hehehe> via mongo?
[15:19:52] <lemonlake> yeah
[15:19:54] <hehehe> like ssh to main box and issue mongo
[15:19:55] <hehehe> what do u get
[15:20:02] <lemonlake> yeah it says 001-rs:SECONDARY> in the prompt
[15:20:04] <hehehe> db.rocket_settings.find( { $text: { $search: "email Email" } } )
[15:20:14] <hehehe> returns nothing
[15:20:16] <hehehe> fat nothing
[15:20:20] <hehehe> oki
[15:20:23] <lemonlake> show collections; fails
[15:20:28] <hehehe> then u need a swtich command
[15:20:30] <lemonlake> saying "not mastedr and slaveOk=false"
[15:20:31] <lemonlake> which is fine
[15:20:36] <hehehe> to switch to primary
[15:20:40] <lemonlake> but i want to connect to the satndalone db
[15:20:41] <lemonlake> not the replset
[15:20:43] <hehehe> yes
[15:20:47] <hehehe> so use some command
[15:20:51] <hehehe> to switch
[15:20:51] <lemonlake> im having the same issue in mongoose
[15:21:02] <lemonlake> my code that uses mongoose doesnt work for the same reason
[15:21:04] <hehehe> dude I am also new to this monster
[15:21:05] <hehehe> :D
[15:21:11] <lemonlake> then dont try and help
[15:21:13] <hehehe> however I can see what i can do
[15:21:15] <hehehe> yes
[15:21:17] <hehehe> its all $%^&*
[15:21:18] <hehehe> :D
[15:21:22] <hehehe> with some exceptions
[15:21:39] <hehehe> 1 moment I can try and figure it out
[15:21:59] <Derick> inoperable: can you share a document, and what you want to find as output (pastebin please)?
[15:22:18] <Derick> hehehe: getIndexes() shows you the index specificaionts - ie - on which fields they are
[15:22:40] <hehehe> yes
[15:22:43] <hehehe> I get it
[15:22:49] <Derick> lemonlake: you can connect to it standalone with most drivers by *not* specifying the replSet=name option
[15:22:58] <lemonlake> yeah, thats what i thought, but its definitely connecting to the replset
[15:23:00] <hehehe> and it shows all fields are indexed
[15:23:06] <lemonlake> because my entire database is not showing up at all
[15:23:17] <hehehe> use dbname works?
[15:23:33] <lemonlake> nope
[15:23:34] <Derick> lemonlake: on the shell? the shell might not support it
[15:23:37] <lemonlake> https://shitty.download/Jihn.png
[15:23:40] <lemonlake> i might be on an outdated shell
[15:23:42] <inoperable> @Derick i got a array of names, and want to find each doc where one of the names matches the name field
[15:24:01] <Derick> inoperable: can you share a document, and what you want to find as output (pastebin please)?
[15:24:05] <lemonlake> shell verison 3.2.10
[15:24:19] <hehehe> Derick: "name" : "$**_text",
[15:24:28] <hehehe> all fields are indexed
[15:24:29] <hehehe> right?
[15:24:31] <Derick> lemonlake: I don't think the shell allows you to connect standalone to a replicaset at all
[15:24:43] <lemonlake> hmm
[15:24:45] <hehehe> why not
[15:24:51] <Derick> hehehe: you need to share the whole output
[15:24:53] <Derick> not just patrs
[15:24:55] <Derick> parts*
[15:24:57] <hehehe> it makes sens
[15:24:58] <hehehe> !!!
[15:25:01] <lemonlake> perhaps i'll need to run two mongodb servers then
[15:25:12] <lemonlake> one standalone, and one in the replset
[15:25:13] <Derick> lemonlake: what are you trying to accomplish?
[15:25:29] <lemonlake> i am running a load balanced rocketchat server across all my servers, which depends on a replicaset
[15:25:41] <lemonlake> however, once i had set that up in a replicaset, all my other programs that use mongodb no longer work
[15:25:59] <Derick> lemonlake: did they give an error?
[15:25:59] <hehehe> https://pastebin.com/3DDFx2h0
[15:26:27] <Derick> hehehe: that looks right
[15:26:44] <lemonlake> nope, it just gets stuck on a Schema.findOne()
[15:26:51] <lemonlake> the promises never yield
[15:27:13] <hehehe> Derick: "name" : "$**_text", is one that deals with all fields right?
[15:27:48] <Derick> hehehe: yes, but that is just the name of the index - the important bit is line 45-47 and 40-41
[15:27:58] <hehehe> db.rocket_settings.find( { $text: { $search: "email Email" } } ) ()
[15:27:58] <hehehe> 2017-08-03T15:27:32.531+0000 TypeError: object is not a function
[15:28:20] <lemonlake> ok, i swapped out the promise library and nwo its logging errors
[15:28:28] <lemonlake> and its the asme error, MongoError: not master and slaveOk=false
[15:28:33] <lemonlake> so its trying to use the replset
[15:28:58] <Derick> hehehe: why do you have () at the end? that's causing your error
[15:28:59] <hehehe> "$**" : 1 means what?
[15:29:14] <lemonlake> https://shitty.download/2sSo.png
[15:29:15] <lemonlake> therse the errors
[15:29:27] <hehehe> ok I run without it - nothing
[15:29:27] <Derick> lemonlake: ah, I think all your apps do *not* specify the replSet=yourName option when connecting to mongodb. You might need to change their connection strings
[15:29:31] <hehehe> but email is there
[15:29:45] <lemonlake> to what? i dont want them to join the replset
[15:30:02] <Derick> that's not how that works
[15:30:10] <Derick> if you have a replicaset, each node will have all the data
[15:30:16] <hehehe> yes
[15:30:18] <hehehe> that is true
[15:30:21] <hehehe> via oplog
[15:30:23] <Derick> you can't have one database only on one node
[15:30:26] <lemonlake> basically, i want to have rocketchat running on a replset
[15:30:28] <lemonlake> and everything else running standalone
[15:30:37] <hehehe> lolol
[15:30:43] <Derick> lemonlake: then you will need an extra server for the standalone data
[15:30:50] <lemonlake> okay, thank you!
[15:30:57] <hehehe> i think if not for rocketchat no one would use mongo much
[15:30:59] <hehehe> :)
[15:31:07] <lemonlake> uhh really? mongo is pretty popular everywhere
[15:31:07] <lemonlake> lol
[15:31:14] <hehehe> nah
[15:31:21] <hehehe> it used to be a fad :D
[15:31:26] <Derick> I had never heard of rocketchat before about an hour ago
[15:31:34] <Derick> hehehe: many of our customers disagree...
[15:31:39] <hehehe> lol but rocketchat is very popupal
[15:31:42] <hehehe> Derick: hmm
[15:31:47] <lemonlake> i like mongodb, though im having a bit of trouble with the replset stuff lol
[15:31:48] <hehehe> but its complex why use it?
[15:32:00] <hehehe> instead of say postregres
[15:32:01] <lemonlake> mongodb isnt complex at all for users and programmers
[15:32:08] <hehehe> .....
[15:32:09] <hehehe> I wish :D
[15:32:19] <hehehe> well maybe you right
[15:32:22] <lemonlake> you just install it, `mongodb://localhost/dbname`, db.collection.insert({ cool: "shit" })
[15:32:26] <lemonlake> its that simple lol
[15:32:28] <Derick> I would also argue it has a lower learning barrier
[15:32:30] <hehehe> that is simple
[15:32:41] <Derick> but it's definitely a big difference from an RDBMS
[15:32:41] <inoperable> @Derick https://pastebin.com/g8QGkUAU
[15:32:53] <hehehe> yes its main bug
[15:32:57] <lemonlake> i would say comparing mongo to postgres is comparing apples and oranges
[15:32:58] <lemonlake> tbh
[15:33:00] <hehehe> its not RDBMS :D
[15:33:07] <Derick> inoperable: ah: you can use the $in operator
[15:33:09] <hehehe> true
[15:33:15] <lemonlake> if you want RDBMS, then go use an RDBMS lol
[15:33:31] <hehehe> lemonlake: dude I got text index on all collections
[15:33:34] <Derick> findOne( { first_name: { $in: [ names ] } } )
[15:33:46] <hehehe> I want to find text email in rocketchat_settings
[15:33:48] <hehehe> yet to work?
[15:33:48] <lemonlake> hehehe: idk i got that working fine on one of my clients websites
[15:33:50] <inoperable> @Derick great! why cant i find this in the docs...
[15:33:54] <hehehe> which command do u use?
[15:34:04] <lemonlake> well this was like a yaer ago i wouldnt remember now but i was using mongoose
[15:34:17] <lemonlake> and i had full text indexing on all collections and it worked fine
[15:34:25] <hehehe> I also have full text indexing
[15:34:30] <hehehe> but yet to work
[15:34:38] <Derick> inoperable: it's in the list: https://docs.mongodb.com/manual/reference/operator/query/
[15:35:14] <hehehe> Derick: db.rocket_settings.find( { $text: { $search: "email Email" } } ) is this a right syntax?
[15:35:27] <hehehe> lemonlake: and why client asked you to do it, instead of ubuntu snap? :D
[15:35:34] <Derick> hehehe: looks right
[15:35:34] <hehehe> they want customisations?
[15:35:44] <hehehe> Derick: then what is wrong
[15:35:52] <lemonlake> hehehe: why would i tell somebody to use ubuntu snap when i could get paid for making them a website
[15:35:52] <hehehe> why its not telling me where Email is in collection?
[15:35:55] <Derick> hehehe: I don't know, you haven't shown me what it outputs
[15:36:07] <hehehe> it outputs nothing...
[15:36:10] <lemonlake> besides, my clients dont even know what ubuntu is
[15:36:11] <lemonlake> they are laymen
[15:36:16] <hehehe> lemonlake: ehehe reallly
[15:36:17] <inoperable> @Derick thanks, i searched with wrong terms and looked into query array
[15:36:17] <hehehe> wow
[15:36:22] <lemonlake> they arent tech people lol
[15:36:28] <lemonlake> they are everyday people who run their own businesses
[15:36:31] <lemonlake> and i make their websites
[15:36:34] <hehehe> lemonlake: yes but its like get aws
[15:36:39] <hehehe> and install ubuntu and rocket
[15:36:39] <hehehe> :)
[15:36:51] <hehehe> I see what you mean
[15:37:02] <lemonlake> if your client found out your job was that simple
[15:37:05] <lemonlake> then they wouldn't pay for you
[15:37:13] <lemonlake> they would give you like $5 because you are literally doing $5 of work
[15:37:19] <lemonlake> if you build the site from scratch, its worth the $3000
[15:37:26] <hehehe> db.rocket_settings.find( { $text: { $search: "email Email" } } )
[15:37:27] <hehehe> >
[15:37:27] <lemonlake> thats how you make a living my dude
[15:37:53] <hehehe> lol lemonlake but they can easily know
[15:38:00] <lemonlake> thats exactly my point?
[15:38:05] <hehehe> they can just google rocketchat howto
[15:38:08] <hehehe> they are very lazy
[15:38:09] <hehehe> :)
[15:38:10] <lemonlake> what
[15:38:11] <hehehe> and its cool
[15:38:13] <lemonlake> this isnt rocketchat
[15:38:16] <lemonlake> i am building actual websites for them
[15:38:17] <lemonlake> >.>
[15:38:26] <lemonlake> this is unrelated to my original question
[15:38:33] <hehehe> lol I though you just made a stand alone rocketchat for them
[15:38:33] <hehehe> lol
[15:38:39] <hehehe> for $$$$ :)
[15:38:41] <lemonlake> no i made a replset rocketchat for myself
[15:38:44] <lemonlake> and my team
[15:38:45] <hehehe> i see
[15:38:49] <Derick> db.rocket_settings.count()
[15:38:56] <Derick> hehehe: try that... does it actually have data?
[15:43:14] <hehehe> Derick: ok it was typo
[15:43:22] <hehehe> mistyped collection name
[15:45:13] <hehehe> Derick: and it simply gives alot of text out
[15:45:26] <hehehe> how I get a list of documents in collection that have that value?
[15:45:43] <hehehe> I also tried mongo compass { "text" : "email" }
[15:46:12] <hehehe> what can I use in a first part of a filter as a wildcard for all fields?
[15:50:47] <hehehe> ok it does work to a degree
[15:50:58] <hehehe> lemonlake: do you know how I do a strict search?
[15:51:07] <hehehe> via mongo shell
[15:51:34] <leolove> Hi. I need a very simple question to ask. My team and I was arguing over using mongodb exclusively or in polygot design. What is your opinion about that? What real-world non-technical explanation I can give to management convincing them that a small app can simply be using mongo exclusively?
[15:53:30] <hehehe> ok I solved it
[15:53:33] <hehehe> ty folks
[15:53:47] <hehehe> lemonlake: btw do you bubble?
[15:53:48] <hehehe> :D
[15:57:08] <Celelibi> Hi there.
[15:57:40] <hehehe> hey
[15:57:51] <hehehe> Derick: ty i :)
[15:57:53] <Celelibi> In a specific set of documents, I would like to remove all the fields but some specific ones.
[15:58:22] <hehehe> not all you mean?
[15:58:38] <hehehe> you could do it by hand with mongo compass
[15:58:43] <Celelibi> Almost all. I want to keep only a specific set of fields.
[15:58:46] <hehehe> a bit of work but works
[15:59:35] <Celelibi> You mean looping on all the documents?
[16:00:07] <hehehe> there gotta be some command
[16:00:10] <hehehe> and yes loop
[16:01:30] <hehehe> I dont know
[16:01:36] <hehehe> maybe i can google it later
[16:03:19] <threespades> https://docs.mongodb.com/manual/reference/operator/update/unset/
[16:04:58] <Celelibi> I saw this, but it would mean I know all the fields to delete.
[16:05:02] <Derick> Celelibi: if you know *which* fields to *remove*, you can just do an update with an unset
[16:10:01] <Celelibi> The problem is that there are currently 25 and more may come later.
[16:10:18] <Celelibi> I wouldn't want to have to maintain the list of fields to remove.
[16:10:38] <Celelibi> I prefer to maintain the list of fields to keep.
[16:10:49] <Celelibi> Which shouldn't change much.
[16:12:41] <lemonlake> should i be surprised that gridfs is absolutely terrible when my servers are 94ms apart?
[16:12:52] <lemonlake> gridfs performance*
[16:21:45] <lemonlake> also, should i be surprised that all the data from before i converted it to a replicaset is gone?
[17:41:52] <hehehe> lemonlake bs
[17:42:02] <hehehe> sounds like you doing something wrong :D
[17:42:26] <hehehe> replicas only read they do not write
[17:42:28] <hehehe> to master
[17:42:49] <hehehe> hehe
[17:59:13] <lemonlake> hehehe: which question are you asnwering?
[17:59:14] <lemonlake> the data loss one?
[17:59:21] <lemonlake> i converted a standalone database to a replicaset
[17:59:24] <lemonlake> and then converted it back
[17:59:30] <lemonlake> and all the data that i had _before_ i converted it to a replicaset is gone
[21:44:17] <jrdn24> So, I have a database that I need to process N results at a time and make sure no other processes touch the results that are processing in previous requests
[21:44:56] <jrdn24> i was hoping for a findAllAndModify command, so without this, is the only way to create a unique ID, update N amount with it's id, then query that ID?