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

Re: MongoDB removing document

by Corion (Patriarch)
on Oct 26, 2015 at 18:53 UTC ( [id://1146025]=note: print w/replies, xml ) Need Help??


in reply to MongoDB removing document

Looking through the documentation, you seem to want to look at MongoDB::Collection instead of blindly calling methods on things that aren't objects.

Replies are listed 'Best First'.
Re^2: MongoDB removing document
by GertMT (Hermit) on Oct 26, 2015 at 19:09 UTC
    just to be clear.. I'm stuck. I did look at that page but haven't been able to find out how to get to a solution by implementing a 'filter expression'.

      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} } );

        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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found