Questions tagged [mongoid3]

Version 3 of Mongoid, an Object-Document-Mapper (ODM) for MongoDB with Ruby. Use this tag for questions relating to this specific version.

Version 3 of Mongoid (an Object-Document-Mapper (ODM) for MongoDB). For a deeper description of Mongoid, see the main Mongoid tag.

Primary tag:

211 questions
0
votes
0 answers

limit(10) in Mongoid 3 / Moped executes count() on entire collection

I have an action which does a simple query which executes quickly, but for some reason it also executes a count() command, which I didn't ask for: In the controller: @things = Thing.active.where(city: "New York", state: "New…
Avishai
  • 4,512
  • 4
  • 41
  • 67
0
votes
2 answers

How to tell DB size with MongoID on Heroku?

We're using the MongoHQ addon on Heroku, with the Mongoid 3.0 adapter. The addon plans come with a size limit, and Mongo will silently fail writing when the DB limit has been reached (unless configured for safe mode--in which case it'll throw…
Wolfram Arnold
  • 7,159
  • 5
  • 44
  • 64
0
votes
1 answer

get mongoid <-> fabrication not working habtm

I have a question to the "has_and_belongs_to_many" and "accept_nested_attributes_for" in context to fabrication and mongoid I have a Location which can have many services class Location include Mongoid::Document field :name field…
Jan
  • 12,992
  • 9
  • 53
  • 89
0
votes
1 answer

Mongoid - two update modifier in single call to update a document in mongodb

I am trying to experiment with mongodb, mongoid and rails. I have a simple Task and Comment model in Rails, where Comments are embedded into Tasks. Now Task has attribute called comment_count. Is there a way of increment the count as well as push a…
Dipayan
  • 113
  • 1
  • 7
0
votes
1 answer

rails mongoid3 and SEO URLs

is there a good way to make "friendly_ids" for the mongoid3 gem? slugoid seems deprecated and KEY is not part of mongoid3 anymore. Any answer will be very helpful
Jan
  • 12,992
  • 9
  • 53
  • 89
0
votes
1 answer

Mongoid render referenced complete object

I am using mongoid 3 in a rails 3 application. I have a client class with referenced object 'files' (so instances of a custom 'LocalisedFile' class.) Client.rb: class Client include Mongoid::Document include Mongoid::Timestamps store_in…
Flo Schild
  • 5,104
  • 4
  • 40
  • 55
0
votes
1 answer

ActiveAdmin + Mongoid localized fields

I'm using Mongoid as a storage and ActiveAdmin as an admin backend in my Rails project. And I need to support a couple of languages. Native Rails i18n works perfectly for static texts. But I need also translate db content. I've found that mongoid…
0
votes
1 answer

map/reduce is failing on Mongoid

I have a class like this class Todo TAG_REGEX = /(?:^|\s)#(\w+)/i include Mongoid::Document include Mongoid::Timestamps include Mongoid::FullTextSearch field :desc, type: String field :done, type: Boolean, default: false field…
Luiz E.
  • 6,769
  • 10
  • 58
  • 98
0
votes
1 answer

Inverse of Mongoid has_one polymorphic association

I have a following model structure. I have an Itinerary that has many itinerary nodes. Each itinerary node is a wrapper around either a place, hotel, activity etc. So for example. Itinerary = "Trip to Paris" Itinerary.itinerary_nodes = [Node1,…
Priyank
  • 14,231
  • 18
  • 78
  • 107
0
votes
1 answer

rails and Mongoid, create Qualification system (Embed qualification into two Models)

i working on a little app to show some pictures. Each picture can be "voted" or "qualified" in a scale of 1 to 5. The qualification can be done for a logged user only one time. I need to know the qualification of each image, and what image a user…
matiasfha
  • 1,270
  • 4
  • 23
  • 42
0
votes
1 answer

How to add ids to hidden field and send it with other data to controller so that allow them to associate with parent model?

I have one post with many pictures. In the one view I have two forms one with standard post fields and another to sending asynchronously pictures to pictures_controller, my JavaScript receives callback only with IDs of new added pictures, not yet…
roza
  • 585
  • 1
  • 9
  • 30
0
votes
1 answer

Mongoid intersect criteria on embedded document

I'm trying to get the intersection of two queries on some embedded docuements using Mongoid 3. So (fake example) imagine I have: class Post embeds_many :comments index 'comments.author_id' => 1 end class Comments embedded_in :post …
Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144
0
votes
1 answer

Mongoid::Criteria#last modifies the criteria and gives wrong results

This is an interesting pattern I found using mongoid (3.0.0), which I suspect is a bug. 1.9.3p194 :007 > products = Product.order_by([:_id, :asc ]).limit(5) => #{"_id"=>1}, :limit=>5}, …
Gautam Rege
  • 697
  • 6
  • 12
0
votes
1 answer

Force namespaced models form to use root class name

I'm using namespaced models to assign different types of services to a platform : Relation : Platform has_many :services & Service belongs_to :platform Inhéritance : Service::Service1 < Service, Service::Service2 < Service, etc. Each service type…
-1
votes
1 answer

Odd exception with mongoid at Heroku

There is an error at heroku I keep getting. It's a Sinatra app which uses Mongoid. Although I have a Rails app hosted there as well, it doesn't cause any error despite the fact that they have exactly the same mongoid.yml files. Here are the logs…
Alexandre
  • 13,030
  • 35
  • 114
  • 173
1 2 3
14
15