Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: MongoDB removing document

by Corion (Pope)
on Oct 26, 2015 at 19:14 UTC ( #1146027=note: print w/replies, xml ) Need Help??

in reply to Re^2: MongoDB removing document
in thread MongoDB removing document

I haven't done any work with MongoDB, but I assume from the following:

# delete a document $coll->delete_one( { name => "John Doe" } );

... that you can delete a single document given its ID by using:

$coll->delete_one( $doc ); # or maybe $coll->delete_one( { _id => $doc->{_id} } );

Replies are listed 'Best First'.
Re^4: MongoDB removing document
by GertMT (Hermit) on Oct 26, 2015 at 19:24 UTC

    Thank you very much for getting back.

    Now I see what you typed it is hard to imagine why I didn't see my mistake in not having $coll as s startpoint to change the collection.

    Happy I can proceed.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146027]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-12-01 13:13 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (10 votes). Check out past polls.