PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 17th of December, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[03:31:00] <shaileshg> Hi, anyone there?
[03:31:14] <shaileshg> could anyone help me understand what does secondary client means
[03:31:23] <shaileshg> or where i could learn more about it?
[03:33:41] <joannac> shaileshg: "secondary client" could be a bunch of things. did you see this in the docs somewhere?
[03:33:46] <joannac> if so, where?
[07:45:41] <tejasmanohar> anyone have an estimate of how long a bulk insert in mongo would take for say 500k very small docs?
[07:45:46] <tejasmanohar> by very small i mean ~162 bytes each
[13:40:37] <someone235> If I have collection that have documents in this structure: {x:{y:{a:1,b:2:c:3}}}
[13:40:47] <someone235> Is it possible to directly query `y`?
[13:40:53] <someone235> something like
[13:41:07] <someone235> db.x.y.find({})
[13:42:30] <StephenLynx> dot notation
[13:42:44] <StephenLynx> db.collection.find({'x.y':value})
[13:54:13] <CustosLimen> hi
[13:54:28] <CustosLimen> besides sw and su - what options should I use for mkfs.xfs
[15:07:04] <latestbot> Quick question, does it usually take mongo to find records by sub fields?
[15:07:10] <latestbot> *log
[15:07:15] <latestbot> *long -
[15:08:42] <cheeser> not if they're indexed
[15:10:57] <latestbot> Hmm, for me findOne for a subfield is taking unusually long
[15:14:33] <cheeser> do an explain and make sure you're using an index.
[15:20:28] <latestbot> Explain?
[15:21:26] <latestbot> I am doing the query like this: “db.testtable.findOne({'raw.snippet.title':"Team Depot and Husky Tackle Repairs for Veteran’s Family”})”
[15:34:11] <cheeser> do you have an index on that field?
[15:43:15] <Spynxic> Anyone know how to push values to an array? I have a collection that looks like so, {u'_id': ObjectId('longhex'), u'myarray': []}
[15:43:31] <Spynxic> however it isn't as simple as collection.update({"$push":{"myarray":1}}) (And if it matters, I'm using PyMongo)
[15:48:37] <cheeser> why isn't that simple?
[15:49:30] <cheeser> why isn't *it* that simple...
[15:53:18] <saml> collection.update({'_id': ObjectId('longhex')}, {'$push': {'myarray': 1}})
[15:53:44] <Spynxic> cheeser: Because it's missing the query argument. Every example I find looks like so, collection.update({"_id":collectionid},{"$push":{"myarray":1}})
[15:54:08] <cheeser> oh. see saml's response.
[15:54:18] <saml> yah the interface is a bit unnatural for python. it'll be more like x = db.collection.find_one(query); x.update({'$push': {'myarray':1}})
[15:54:43] <saml> but in pymongo, returned value of find_one is a simple dict
[15:55:55] <HarryKalahan> Hi all
[15:56:27] <HarryKalahan> i'm trying to add a role to an existing user, but I obtain the following error message
[16:03:24] <HarryKalahan> db.runCommand( { grantRolesToUser: "sm_gradiant", ... roles: [ ... { role: "read", db: "PosidoniaEvents"} ... ] } ) { "ok" : 0, "errmsg" : "Could not find user sm_gradiant@PosidoniaEvents", "code" : 11 }
[16:04:48] <HarryKalahan> i'm specifing sm_gradiant user, not sm_gradiant@PosidoniaEvents
[16:04:58] <HarryKalahan> why I obtain this error message?
[16:05:22] <HarryKalahan> i'm following the instrucctions from mongo website
[16:06:05] <HarryKalahan> https://docs.mongodb.org/v3.0/reference/command/grantRolesToUser/
[16:07:39] <HarryKalahan> could anybody help me, please?
[16:10:42] <saml> HarryKalahan, do you have sm_gradiant user?
[16:12:16] <saml> db.runCommand({usersInfo:{user:'sm_gradiant', db: 'PosidoniaEvents'}}) try this
[16:12:30] <saml> maybe you haven't created the user yet
[16:12:56] <saml> https://docs.mongodb.org/v3.0/reference/command/usersInfo/#view-all-users-for-a-database
[16:20:44] <HarryKalahan> yes, the user is created
[16:21:26] <HarryKalahan> > db.runCommand({usersInfo:{user:'sm_gradiant', db: 'PosidoniaEvents'}}) { "users" : [ ], "ok" : 1 }
[16:21:46] <HarryKalahan> i have two dbs
[16:22:03] <HarryKalahan> data and PosidoniaEvents
[16:22:15] <Spynxic> saml: Thanks, your solution worked out great. I just realized the objectid is returned when inserting an item into the collection so that eliminates the need to query
[16:22:55] <saml> HarryKalahan, that means there's no such user
[16:23:07] <HarryKalahan> the sm_gradiant user has role "read" over data
[16:23:20] <saml> but no such user on PosidoniaEven
[16:24:07] <HarryKalahan> { "_id" : "agata_data.sm_gradiant", "user" : "sm_gradiant", "db" : "agata_data", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "cOyEERH", "storedKey" : "2STagprNbMf", "serverKey" : "C9vQ2+U5gE/+VJ/" } }, "roles" : [
[16:24:34] <HarryKalahan> "roles" : [ { "role" : "read", "db" : "agata_data" } ] }
[16:25:21] <HarryKalahan> i want to add sm_gradiant read access to PosidoniaEvents DB
[16:28:32] <saml> maybe try db.grantRolesToUser('sm_gra', [{role: 'read', db: 'Pos..
[16:30:00] <HarryKalahan> i tried it to, but I obtain the same
[16:30:37] <HarryKalahan> > db.grantRolesToUser( "sm_gradiant", [ { role: "read", db: "PosidoniaEvents" } ] ) 2015-12-17T17:25:46.690+0100 E QUERY Error: Could not find user sm_gradiant@admin at Error (<anonymous>) at DB.grantRolesToUser (src/mongo/shell/db.js:1298:15) at (shell):1:4 at src/mongo/shell/db.js:1298
[16:33:59] <saml> did you create role named "read" ?
[16:34:32] <HarryKalahan> i supose read role is one of the mongo's
[16:39:59] <HarryKalahan> well, i couldn't use grantrolestouser
[16:40:41] <HarryKalahan> i've created the same user pointing to PosidoniaEvents
[16:41:17] <HarryKalahan> db.createUser( { user: "sm_gradiant", pwd: "pass", roles: [ { role: "read", db: "PosidoniaEvents" } ] } )
[16:42:25] <HarryKalahan> so in system.users collection i obtain the same user twice witd _id: agata_data.sm_gradiant and _id: PosidoniaEvents.sm_gradiant
[16:43:06] <HarryKalahan> it works, but I don't know why I can't use grantrolestouser
[16:43:44] <HarryKalahan> thanks anyway
[16:56:16] <tkotthakota> Java.Util.Date issue: Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.Date out of START_OBJECT token
[16:56:23] <tkotthakota> Any thoughts on why I see above error when fetching a mongo doc which has Date attribute (stored as NumberLong("12334"))?
[16:57:11] <cheeser> why aren't you storing dates as Dates?
[16:58:32] <tkotthakota> So my object has java.util.Date attributes..
[16:58:57] <tkotthakota> They are stored as "timeCreated" : NumberLong("1450210326397")
[16:59:23] <tkotthakota> In fact, I am little puzzled as well as I expect it to be stored as ISODate..
[16:59:46] <cheeser> if you can fix that, that'd be better.
[16:59:48] <tkotthakota> When I fetch the document I get above exception
[17:00:00] <tkotthakota> What would be the fix?
[17:00:19] <cheeser> there's also this: https://github.com/ylemoigne/mongo-jackson-codec
[17:00:24] <tkotthakota> I wonder if I need to go with for ORM like MongoJack..
[17:00:33] <cheeser> the fix would be to properly store your documents with Dates
[17:00:46] <cheeser> tkotthakota: i prefer Morphia but that's because i'm the maintainer ;)
[17:00:55] <tkotthakota> ok :)
[17:01:24] <tkotthakota> One issue with Mongo jack is it is using older version (DBCollection) instead of MongoCollection.
[17:02:50] <cheeser> Morphia is in the same boat. it's mostly tranparent to you, though.
[17:02:54] <tkotthakota> cheeser, Is mongo-jackson-codec helps in storing Dates in correct format?
[17:03:09] <tkotthakota> Is there an example of usage?
[17:04:32] <tkotthakota> Does MongoJack or Morphia helps me in avoiding aove codec library?
[17:05:20] <cheeser> well, if you keep those dates as numbers, you'll need to provide a converter
[17:05:42] <cheeser> that's not hard with morphia. not super hard with mongo-jack, i'd imagine but i've not tried it.
[17:06:04] <cheeser> i've done it with jackson and that wasn't hard. not sure if mongo-jack makes that easy or not.
[17:16:16] <tkotthakota> Is there an example on usage of Jackson on storing Dates as dates (not numbers)?
[17:16:51] <cheeser> i dunno offhand
[19:37:02] <uuanton> hello world
[19:41:54] <foundatron> hi uuanton!
[19:45:24] <THK> test
[19:46:22] <uuanton> first time asking question here. I'm working on 2.6.11 mongodb restore script on centos 7 and the database pretty big so that when you start it takes more than TimeoutStartSec=5min to start therefore it fails to start. Can't find the way to update TimeoutStartSec or other solution
[19:46:50] <uuanton> sudo systemctl set-property mongod TimeoutStartSec=5min
[19:47:00] <cheeser> database size doesn't affect start up time.
[19:47:58] <uuanton> well I guess since journal has to recover and prealloc has to happen it takes more than 5 min and it fails
[19:54:35] <uuanton> sudo systemctl set-property mongod TimeoutStartSec=15min gives me error"Unknown assignment TimeoutStartSec=15min"
[22:41:48] <bhang> MongoDB 2.6.11 - is there any way to remove a secondary member from a replica set without causing an election ?
[22:48:31] <noqqe> when i sort and limit a query, how can i reverse the order ?
[22:48:57] <noqqe> .sort({"date", 1}).limit(10) does not do the job
[22:49:12] <noqqe> either i get the first results or the last, but in the wrong order
[23:13:48] <joannac> noqqe: ? maybe an example would help
[23:14:05] <joannac> bhang: don't think so
[23:14:45] <bhang> joannac: ok, thanks
[23:40:35] <uuanton> clear