Skip to content

Collection table data not showing updated when editing mongo directly #4501

@ericuldall

Description

@ericuldall

Link to reproduction

No response

Describe the Bug

I have a query in an order collection that changes my stock for inventory items using $inc

              const inventory = payload.db.collections.inventory
              await inventory.findByIdAndUpdate(
                inventoryItem.id,
                {
                  $inc: { stock: quantityDiff }
                }, {
                  new: true
                }
              ).exec();

The fields are updated correctly when looking at the edit form for that collection item, but the data is showing the previous value when looking at the list of collection items.

Is there some extra step I need to take to fully commit that change?

To Reproduce

Enable versions, then edit mongo data directly.

Payload Version

2

Adapters and Plugins

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions