PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 9th of November, 2018

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:11:55] <Jonno_FTW> hello
[01:12:49] <Jonno_FTW> anyone in? my cursors keep being not found after processing for a long time, even though I set them to not timeout
[06:57:31] <humblewolf> hello everyone.... Is couchdb schemaless like mongo ?
[09:59:47] <Derick> it's schemaless, but not like mongo
[13:01:04] <MrF> Hello, I have issues using mongodb shell maybe someone can help. I have database running on localhost default port with database named "testdb" with collection named "somestuff" it has one entry named "name: test1" that has string variable "progress: 1".
[13:01:33] <MrF> now when I run command: mongo localhost:27017 --eval 'testdb.somestuff.update({"name":"test1",{$set:{"progress":"44"}});' i get no error but test1 document is not updated
[13:49:55] <Derick> MrF: "testdb" wouldn't be defined
[13:50:31] <Derick> MrF: https://docs.mongodb.com/manual/tutorial/write-scripts-for-the-mongo-shell/#differences-between-interactive-and-scripted-mongo
[13:50:59] <Derick> see the second entry in that table, on how to get "db" variable pointing to the right database
[13:51:19] <Derick> also, read the first bullet point
[13:51:55] <Derick> your script in the --eval line should probably start with --eval 'db=getDB("testdb"); db.somestuff.update
[13:55:43] <MrF> Derick: Idid, it is confusing because on that doc page there is example mongo test --eval "printjson(db.getCollectionNames())" that connect to test database and prints collection and here there is no db=getDB("testdb");
[14:03:06] <MrF> Ok figured it out. i did use wrong method. update and updateOne works only on object and will not work with normal field. I did use findAndUpdate instead and now it works
[14:03:18] <MrF> findAndModify*
[14:16:07] <_aeris_> hello here !
[14:16:35] <_aeris_> mongo doc says "db.xxx.createIndex( { "yyyy": 1 }, { unique: true, sparse: true } )" must ignore all entry with null or missing yyy attribute
[14:17:07] <_aeris_> but when running on my dataset, got
[14:17:07] <_aeris_> « E11000 duplicate key error collection: xxx index: yyyy_1 dup key: { : null } »
[14:23:28] <Derick> is yyyy a multi-key field? i.e., an array?
[14:27:32] <_aeris_> no, simple field
[14:28:07] <_aeris_> just string if any, and in my case, all entries have this field to null at this moment
[14:29:21] <_aeris_> seems strange, exporting then reimporting and the index creation is ok
[14:31:09] <Derick> that seems odd
[14:34:39] <_aeris_> https://paste.imirhil.fr/?ac4ca6a58441f5fd#GwvR3aNZwLtYaTSt+yNl+8lMHh4oyqJYrFaCUW1aqEk=
[14:52:12] <_aeris_> this is damn insane… https://paste.imirhil.fr/?886dfff001839e9d#7hpyOU8C0GeCxIrk1gh0BsNxek6VG78zNXAbj8DMvgg=
[15:01:33] <_aeris_> ok, seems null is a value for sparse, only really missing attribute is not considered
[15:05:24] <Derick> ah, yes
[15:05:26] <Derick> :-/
[18:59:55] <rc96> Hi, how can I list a collections with just a single field? I've tried db.mycoll1.find({name})