Skip to content

support for replace_one #103

Open
Open
@krcurtis

Description

@krcurtis

Hi,

I have some Python code that I'd like to translate to Haskell where I was able to use replace_one, and check that the calling process actually made the update (as opposed to another process trying to make a similar update concurrently):

result =  db.tasks.replace_one( ... )
if 1 == result.matched_count and 1 == result.modified_count:
    print("Updated item!")

I tried using replace from Database.MongoDB.Query but it doesn't seem to return any information about whether it succeed or not. I'm guessing some support needs to be added for that, or if not, how do I check that?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions