[01:31:19] <zsoc> I have a super noob question if someone could be so kind as to humor me. I have a schema like user, password, key, accounts, trabsactions. The accounts and transactions are an array of objects. Can i use a schema like and insert 'documents' (like partial schemas?) Into those array elements? Like add objects to the transaction array, for instance?
[01:31:52] <zsoc> Or should there be a separate table for each and then insert them as like entire matching documents
[01:35:10] <zsoc> Is this the difference brtween multiple collections or embedded documents?
[01:39:27] <zsoc> I guess what im trying to figure out is.. If are embedded, and not separate collections.. What is the methodology of inserting pieces like.. objects into part of an embedded array of objects for instance
[01:43:06] <crazyphil> ok, I've got a mongorestore running to put some data back into my setup, however I have active apps also pushing data in, is there a way to find a record that was inserted "now"?
[01:50:16] <Boomtime> @zsoc: yes, you are asking about embedding versus referencing
[01:50:46] <Boomtime> see operators like $push for partial doc update / array manipulation; https://docs.mongodb.org/manual/reference/operator/update/push/
[01:52:26] <zsoc> Boomtime: Great thank you. So the advantage id that if they were separate collections.. Id need to have a property in each other collections entry to relate to what user it belongs to. Vs having one collection for each user with all their stuff embedding.
[01:54:14] <Boomtime> a 'collection element' is probably the right thing - a single object in the collection
[01:54:23] <zsoc> Hmm. Im trying to wrap my head around how to figure out which is better depending on your use case.
[01:54:33] <Boomtime> what you pass in a 'insert' statement is also it
[01:54:54] <zsoc> I can see the size limitation being a big reason NOT to use embeddeds... If its a lot of data
[01:55:26] <Boomtime> right - but you'll probably find it has become unwieldy to use before you get there anyway
[01:55:47] <zsoc> But its a serious advantage to embeddeds to be able to just retrieve ALL of one thing from one user with out having to go to different collections and then joining them
[01:57:05] <Boomtime> indeed, it's awesome when used correctly
[01:58:27] <Boomtime> don't be afraid to use both too; like keep the first/top 5 (for example) of something in an embedded array and then references for everytrhing beyond that number
[01:59:01] <Boomtime> often times when you have a lot of something and qant quick access, you usually only need 'quick' access to the first few or so
[02:03:47] <zsoc> Hmmm that seems like a good idea actually.. But i don't know if it would get messy. Having to cycle out the top X of something back into a separate collection
[02:04:48] <zsoc> But yeah. I could have recent transactions embedded and then archived transactions in a separate collection..
[06:02:09] <Siegfried> Hi all, brand new to mongo and have a simple question
[06:02:22] <Siegfried> Do I want to download the build with SSL or not? and what's the difference?
[06:07:10] <Boomtime> 'download the build with SSL' - is there one without it?
[06:07:27] <Boomtime> maybe link what you are referring to
[06:22:10] <Boomtime> "The binary of this version has been compiled with SSL enabled and dynamically linked. This requires that SSL libraries be installed seperately. See here for more information on installing OpenSSL."
[06:23:06] <Siegfried> Will I have to do complex decryption every time I want to use my mongo instance?
[06:23:28] <Boomtime> erg.. are you seriously going to be running a server on OSX?
[06:23:38] <Siegfried> Well I'm completely new to this
[06:23:46] <Siegfried> Also this is my only computer
[06:23:47] <Boomtime> ok - osx build is essentialy provided for dev purposes
[06:24:14] <Boomtime> there aren't even support contracts available for it and it's not listed as a supported build - it's a kind of 'best effort' thing
[06:26:20] <Boomtime> SSL, or more correctly TLS since mongodb doesn't actually support any version of vanilla SSL (only TLS), is transport level security - socket layer crypto - if you're just developing/learning you don't need it
[06:27:47] <Boomtime> if your use of mongodb will be entirely internal such that you can't connect directly to mongodb from "the internet" (eg. only via your webapp) then you probably still don't require ssl
[06:28:08] <Boomtime> your webapp will be better off with the ssl support
[06:28:33] <Boomtime> if you enable ssl on mongodb but not on your webapp then it's needlessly complicated because the webapp will be the weak point anyway
[13:32:02] <alexi5> is mongodb used for ecommerce applications ?
[13:32:20] <alexi5> do you guys know an exampls of its application in this area ?
[13:35:36] <kali> mongodb is a general purpose database. it can help in any industry. for ecommerce, it can be very helpful to deal with catalog data, for instance, but the absence of arbitrary transaction may make implementing payment and checkout difficule and awkward
[13:46:25] <alexi5> i am thinking of using mongodb for a wifi charging application where a user purchases a wifi plan and have it provision on a gateway for the device. the database will store the plans,orders ,payment result from payment gateway,and provisioning config for gateway
[13:49:34] <kali> well, it can do it, but the transaction part will be tricky, and from what you're saying there are few parts where it will shine compared to a relational database
[13:52:14] <alexi5> i was thinking having a cart document with a state attribute
[13:52:34] <alexi5> the attribute can have values cart, failed,success
[13:53:16] <alexi5> cart= purchase has not been checked out, failed = for failed payment transaction,success= successful payment transaction
[13:54:47] <alexi5> give me an example of areas where transaction part may be tricky
[14:52:21] <unknowndomain> Just wondering if anyone knows a way to update the property of an object in an array inside a collection… i.e. collection.property[0].propertyToBeEdited = Date()
[14:52:57] <unknowndomain> I know I can do it with $set but then if anyone else edits simulationously then I loose one person’s edit
[20:25:23] <zsoc> I have an odd question, and I'm not sure how to figure out if it's mongo or passport or what. I have a small test web app that lets me register a user with a 'local' passport strategy. If I create the user, connected to a remote database, with the app running on my localhost. I can log in and out fine on my localhost. But when I run the app on the remote server, with the same database, i can't login with that user. And the opposite is the same, if i create th
[20:25:23] <zsoc> e user with the app running on the remote server, i can only log in remotely. Even though it's the identical database being used located on the remote server in both instances.
[20:30:00] <zsoc> So I guess it's passport authentication that's failing because it's returning a 401 unauthorized. But why does it matter where the app was running when the user was created, if either way it's connected to the same db as the same admin user?