FAQ
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:

Model.all.delete

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 | 1 of 6 | next ›
Discussion Overview
groupmongoid @
categoriesmongodb, rubyonrails
postedJun 4, '12 at 9:34p
activeJun 5, '12 at 4:20p
posts6
users2
websitemongoid.org
irc#mongoid

2 users in discussion

Cult hero: 4 posts Durran Jordan: 2 posts

People

Translate

site design / logo © 2022 Grokbase