moped

Rails Mongoid fails to authenticate - failed with error 13: “not authorized for query on my_db.my_collection”

亡梦爱人 提交于 2019-12-18 19:07:18
问题 This issue was said to be resolved the latest version of Moped but still happens to me. I have a rails 4.2 app with Mongoid, created a user for a MongoDB DB with readWrite and dbOwner roles, and set auth=true in the mong.conf file. I can perform any actions on the DB with that user credentials using the Mongo shell or a simple Java application using their Mongo driver. However, when trying to authenticate with Mongoid I always get this error: failed with error 13: "not authorized for query on

Mongoid aggregation $match with Date objects not working?

丶灬走出姿态 提交于 2019-12-12 05:25:09
问题 I have User documents in a collection that have this structure: { "_id" : ObjectId( "4fb54ef46d93b33b21003951" ), "activities" : [ { "id" : ObjectId( "4fd66f9001e7fe9f03000065" ), "type" : "checkin", "date_time_created" : Date( 1339453328000 )}, { "date_time_created" : Date( 1337351732000 ), "date_time_updated" : Date( 1337351952635 ), "id" : ObjectId( "4fb65e346d93b3fe77000000" )} ] } I can easily query these documents based on date: User.where( :activities => { '$elemMatch' => { :date_time

Mongoid 4 / MongoDB 2.4+ “Freezing” Issue

允我心安 提交于 2019-12-10 18:02:20
问题 I've had a strange issue since with maintaining a connection to mongodb using Mongoid. I thought this was originally due to upgrading to Rails 4.0+ (which required Mongoid/Moped to be updated), but I've also had this issue with other Rack-based apps (Sinatra and Grape to be specific). We updated our mongodb instance from 2.4 to 2.6 after the stable was released, but this issue was present on 2.4 as well. I wrote this up in an issue on Github (https://github.com/mongoid/moped/issues/274) but I

Rails Mongoid fails to authenticate - failed with error 13: “not authorized for query on my_db.my_collection”

戏子无情 提交于 2019-11-30 17:45:48
This issue was said to be resolved the latest version of Moped but still happens to me. I have a rails 4.2 app with Mongoid , created a user for a MongoDB DB with readWrite and dbOwner roles, and set auth=true in the mong.conf file. I can perform any actions on the DB with that user credentials using the Mongo shell or a simple Java application using their Mongo driver. However, when trying to authenticate with Mongoid I always get this error: failed with error 13: "not authorized for query on my_db.my_collection" Here is the relevant portion of my mongoid.yml file: production: # Configure