All Questions
Tagged with mongodb ruby-on-rails
5 questions
3
votes
2
answers
102
views
Persist relation to a class (and not a class instance) in Ruby on Rails with Mongoid
Assume my users can subscribe to several plan_types. I want to define those plans as classes, and be able to keep, for each user, a reference to a subscription_plan and also a presubscription_plan. ...
0
votes
1
answer
131
views
List User Online Status
I'm using Rails with MongoDB for database. In my apps I have 1 action for displaying list of users. User has name, image, ...
2
votes
0
answers
492
views
Scoping through embedded document in MongoId
I'm using MongoId in a Rails project. I need to select some products which contain some SKUs which has an embedded document. The models are respectively Product and ...
1
vote
2
answers
2k
views
Finding mongodb records in batches using mongoid [closed]
I want to get records in batches. But mongoid doc says to avoid using skip due as it can be expensive. I wrote this method to iterate through a large number records efficiently.
...
3
votes
1
answer
97
views
Probability ordering by seller's tariff
I have an instance method which calculates the position of an element, depending on the tariff of its seller.
If the seller is of a level3 tariff, it gets to top ...