Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

MongoMapper Recent threads

Threads Replies First post Last post
Re: Possible to duplicate document in associations?
By: Gary
All sound advice indeed. Student and Course and not our models, though, just an analogous relationship that people can grasp. Gary On Monday, May 21, 2012 5:42:19 PM UTC-4, Justin Dossey wrote: > > You might do well to have a join…
0 May 23 2012
21:09
May 23 2012
21:09
Re: Possible to duplicate document in associations?
By: Gary
All sound advice indeed. Student and Course and not our models, though, just an analogous relationship that people can grasp. Gary On Monday, May 21, 2012 5:42:19 PM UTC-4, Justin Dossey wrote: > > You might do well to have a join…
0 May 23 2012
21:09
May 23 2012
21:09
Re: Possible to duplicate document in associations?
By: Gary
Looked through the code tonight. Trying to decide between writing a new plugin like Plugins::DuplicatedDocument or overriding BelongsToAssociation.new to accept a :duplicate option and handle it there. Leaning toward…
0 May 23 2012
21:02
May 23 2012
21:02
Document-level locking and concurrency issues
By: Luis Corrêa d'Almeida
Given a persisted document with the following attributes: { first_name: Alice, age: null, phone: null } and the following execution path, Thread 1: load document Thread 2: load (same, yet unaltered) document Thread 1: document.age = 21 and…
6 May 21 2012
18:48
May 22 2012
09:07
How to prevent undeclared attributes in mass assignment
By: foreverman
Hey, Seems we can insert anything into database through mass assignment(except declaring attr_accessiable), class User include MongoMapper::Document key :name end u = User.new(:name => 'sean', :abcdefg => 'anything') u.abcdef #anything …
0 May 21 2012
03:28
May 21 2012
03:28
querying in embedded documents
By: ds2k
I have two models: Media (embedded document), and Tweet (document). Message has a Media Media has a key named title I want do do a search on all Messages where media.title = "foo" OR "bar" What is the correct MM query string for this? I've…
8 May 9 2012
18:47
May 10 2012
14:23
Multiple conditions for same field in query?
By: Panabee
Hi all, We are trying to use multiple conditions for the same field, but it seems like the query is failing. Here is the query: pool = Foo.where( :ios_token.ne => nil, :username_downcase.ne => 'willie', :username_downcase.ne => 'you'…
3 May 7 2012
23:40
May 8 2012
13:05
MongoMapper and document size
By: Justin Dossey
Hi all, After more poking around in the MM source code, I wonder whether there is some room to improve efficiency of document storage in MongoDB. The short answer is that if a field has not been changed from null, zero, or the empty string, it…
3 May 3 2012
17:27
May 4 2012
16:48
Re: model objects in modules.
By: Darren Schnare
If you are looking for other options supported on associations then look here: https://github.com/jnunemaker/mongomapper/blob/master/lib/mongo_mapper /plugins/associations/base.rb This is the base class for all associations. I don't know what…
0 May 2 2012
06:14
May 2 2012
06:14
IdentityMap on a different field
By: Leif
Hi I'm trying to figure out if the current Identity Map plugin supports a different field than ID as the map id? I have a model like this: class Article include MongoMapper::Document plugin MongoMapper::Plugins::Sluggable sluggable :title …
2 Apr 30 2012
05:42
Apr 30 2012
12:35
Can't chain model methods if method doesn't return a query
By: Richard Livsey
In MongoMapper::Plugins::Querying::Decorator, the method_missing currently looks like so: 1> def method_missing(method, *args, &block) 2> return super unless model.respond_to?(method) 3> result =…
11 Sep 28 2010
17:16
Apr 29 2012
20:14
Key data type specification
By: Justin Dossey
Hey all, It looks like my Integer fields translate into 8-byte integers (NumberLong in the MongoDB console). Sometimes, I don't really need that much-- a 4-byte unsigned integer would be plenty in many cases (e.g. IP address representation). …
1 Apr 29 2012
11:07
Apr 29 2012
12:30
MongoMapper and documents with large (>650) list of embedded documents
By: skaestle
Hi all! I have Categories that contain SortableArticles as embedded documents: class Category include MongoMapper::Document key :name, String key :legacy_id, Integer key :length, Integer # TODO: rename this association many…
9 Apr 26 2012
06:36
Apr 27 2012
10:42
Release of forked embedded-callbacks-optional branch
By: Jamie Orchard-Hays
Wanted a snapshot of this change released until the change makes it to master and gets released: https://rubygems.org/search?utf8=✓&query=jamieorc-mongo_mapper jamieorc-mongo_mapper (0.11.1.1) Jamie
0 Apr 27 2012
10:13
Apr 27 2012
10:13
Extend plucky for atomic updates?
By: Justin Dossey
What do you think of the idea of adding atomic updates to Plucky? Example usage: Person.where(:name => 'John Doe').upsert() Person.where(:name => 'John Doe').set(:age => 30) Person.where(:name => 'John Doe').increment(:votes => 1) …
2 Apr 26 2012
10:37
Apr 26 2012
11:06
Typical config/setup without Rails, and other questions
By: Darren Schnare
Hey guys, I love MongoMapper, but as a new Ruby user I'm finding it challenging to find information regarding proper configuration/setup. I'm not interested in using Rails, so I'm looking for documentation on how to get started without Rails.…
4 Apr 21 2012
14:33
Apr 26 2012
07:39
Embedded Polymorphic Composite Pattern
By: Darren Schnare
Hello, I've spent some time reading the documentation and email group for some insight into my problem, but haven't arrived at a satisfactory solution. I figure I would ask if anyone has implemented an Composite pattern. Example: I wish to…
1 Apr 21 2012
21:20
Apr 22 2012
12:56
Return error from :safe => true? And does using :safe => true materially increase reliability
By: Panabee
Hi all, According to the MonoMapper docs, using :safe => true on saves is supposed to increase reliability by " the driver to make sure the save succeeds and raise an error if it doesn’t." Could someone elaborate on the…
3 Apr 19 2012
14:10
Apr 21 2012
16:25
Callbacks on large number of EmbeddedDocuments blows stack
By: Jamie Orchard-Hays
I wonder if anyone else has encountered this. I've written a detailed description in a bug ticket at github. https://github.com/jnunemaker/mongomapper/issues/405 (Not a problem on Rails 2.3.x and MM 0.8.6.) I'm hoping to have time to dig into…
0 Apr 16 2012
08:58
Apr 16 2012
08:58
Does a modifier function like "pull" trigger callbacks like "after_save" on the
By: Mohamed Ashraf
Does a modifier function like "pull" trigger callbacks like "after_save" on the object?
4 Apr 9 2012
14:30
Apr 10 2012
14:55