#MongoDB database is different than Payload

19 messages · Page 1 of 1 (latest)

wispy sorrel
#

So the data in the collection is not accurate, I have 2 records showing up in the dashboard but when I login to mongodb I can see 25 records in that collection.

I encountered this issue multiple times, the data is not synced properly.

Sometimes I have to change Show per page to 100 for the page to reload and show the correct data.

Is there a reason why this is happening?

iron turret
#

Can you provide more information here? What version are you on? Are there any custom hooks on your collection?

wispy sorrel
#

@iron turret thanks

#

I think the issue might be here

#

access: {
read: ({ req }) => {
if (req.user) return true
return {
_status: {
equals: 'published',
},
}
},

#

I am on latest version

#

I added this access so draft posts are not showing up for api

#

But when logging to dashboard i dont see the draft posts anymore

#

Unless i click on view x amount and they show up

iron turret
#

Unless i click on view x amount and they show up
That is unexpected, your read access hook looks fine to me. Can open up your browser's network tab and look for the requests being made when you navigate that page?

wispy sorrel
#

so there is one particular request /api/posts?locale=en&depth=0&draft=true that looks interesting

#

and it only has 2 records

#

if I remove &draft=true

#

I can see all posts returned

iron turret
wispy sorrel
#

@iron turret oh yes, does look like the same issue I am facing, I also have version enabled

iron turret
#

Ok this is currently fixed in our canary release which is expected to be merged tomorrow or so

wispy sorrel
#

@iron turret is this going to be released soon?

iron turret
#

We're on track for tomorrow AM