[Rails] Re: Example of work with mongo

2011-08-18 Thread Alexey Petrushin
More examples: Save any pure Ruby object (also complex & nested) in MongoDB https://github.com/alexeypetrushin/mongo_db + driver API enhancements (100% backward-compatible with original API), makes API more friendly & handy, no extra abstraction or complexities introduced, all things are exact

[Rails] Re: Example of work with mongo

2011-08-12 Thread Alexey Petrushin
Simple blog built with MongoDB http://rad-sample.heroku.com sources https://github.com/alexeypetrushin/rad_sample -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai

Re: [Rails] Re: Example of work with mongo

2011-03-04 Thread Hassan Schroeder
On Fri, Mar 4, 2011 at 8:54 AM, Bryan Crossland wrote: > I think you will find that this will work better. It will return an array of > just the people's names and then you can iterate over them. > > arr_person = Person.find(:all).map {|p| p.name} It would if the OP were using ActiveRecord with

Re: [Rails] Re: Example of work with mongo

2011-03-04 Thread Bryan Crossland
On Fri, Mar 4, 2011 at 10:30 AM, Manny 777 wrote: > Hi Hassan, > thanks for your reply. > > This works, but if I am trying to select only one attribut from the > whole document, > > db["testCollection"].find['name'] > > so that isn't working. I must to type: > > @array=db.collection('people').fi

Re: [Rails] Re: Example of work with mongo

2011-03-04 Thread Hassan Schroeder
On Fri, Mar 4, 2011 at 8:30 AM, Manny 777 wrote: > This works, but if I am trying to select only one attribut from the > whole document, I'm not sure if you're trying to get only documents with a given name or show the names of all documents, but have you gone through this:

[Rails] Re: Example of work with mongo

2011-03-04 Thread Manny 777
Hi Hassan, thanks for your reply. This works, but if I am trying to select only one attribut from the whole document, db["testCollection"].find['name'] so that isn't working. I must to type: @array=db.collection('people').find() #I'm selecting everything :/ i=0 for polozka in @array puts "#