I'd like to add that THIS works:

{ name: "Photek" }
).update_all({ "$set" => { label: "Mute" }})

So there's either an option I need to toggle or... something else that's
changed on me.
On Monday, June 4, 2012 2:34:42 PM UTC-7, cult hero wrote:

We started a project using Mongoid recently and since we're early in
development I figured I'd just get used to using 3.x. I installed the RC
the other day and after a little bit of refactoring noticed that most
things were working well (I gotta say, I'm very happy with custom data
types now).

With that said, here is a piece of code that used to word and doesn't now:


This works: Model.delete_all

That was acceptable. Here's the problem though, Model.all.delete produces
this in my log:

MOPED: localhost:27017 COMMAND database=db_name
command={:count=>:events, :query=>{}} (0.0ms)
MOPED: localhost:27017 DELETE database= db_name collection=models
selector={"$query"=>{}, "$orderby"=>{"_id"=>1}} flags=[] (0.0ms)

It seems like it SHOULD be deleting. Just the same, the following example
from the new docs: Band.where(name: "Photek").update(label: "Mute")

Doesn't seem to work. Maybe I'm missing something in the new setup, but I
cannot seem to do mass updates of any sort.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 6 | next ›
Discussion Overview
groupmongoid @
categoriesmongodb, rubyonrails
postedJun 4, '12 at 9:34p
activeJun 5, '12 at 4:20p

2 users in discussion

Cult hero: 4 posts Durran Jordan: 2 posts



site design / logo © 2022 Grokbase