Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: MongoDB removing document

by GertMT (Hermit)
on Oct 26, 2015 at 18:07 UTC ( #1146019=note: print w/replies, xml ) Need Help??

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

Thank you for your reply

Unfortunately I keep getting the message:

Can't call method "delete_one" on unblessed reference at line...

I'll investigate further.

Replies are listed 'Best First'.
Re^3: MongoDB removing document
by stevieb (Canon) on Oct 26, 2015 at 18:29 UTC

    I know absolutely nothing about MongoDB, but I can tell you that you're trying to call a method on something that doesn't have any (a plain hash reference).

    In the MongoDB documentation's SYNOPSYS, it shows that to delete a document, you call the method against the collection ($coll) object like this: $coll->delete_one({ name => 'value' });

    For completeness, here's the expanded documentation specifically for the delete_one() method.

    When in doubt, RTFM ;)

      Thanks, after studying the documents (that are really well done!) I indeed do have a problem executing the proper commands while iterating the MongoDB::Cursor. There are not too many examples of that.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-10-28 21:05 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (96 votes). Check out past polls.