thephpleague / monga

Simple and swift MongoDB abstraction.
MIT License
331 stars 30 forks source link

Multiple remove (not issue) #31

Closed rhnkyr closed 8 years ago

rhnkyr commented 8 years ago

I want to remove every document which have same id. My code is

$comments = $this->mongo->collection(Collections::COMMENTS);
        $comments->find(function ($query) use ($check) {
            $query->where('cid', $check)->remove()->multiple();
        });

is this type of use correct? Thanks in advance...

bcrowe commented 8 years ago

Check out the Delete section of the gh-pages.

rhnkyr commented 8 years ago

@bcrowe thanks.