Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Fetching Wrong Documents #33

Open
2 tasks done
salmansheri opened this issue Aug 3, 2024 · 2 comments
Open
2 tasks done

Bug Report: Fetching Wrong Documents #33

salmansheri opened this issue Aug 3, 2024 · 2 comments

Comments

@salmansheri
Copy link

👟 Reproduction steps

When I try to fetch my appointments documents, it shows some incorrect counts even though the collection is empty

appointmentcollection

My Appointment Collection is empty

My Code:

 const appointments = await databases.listDocuments(
      DATABASE_ID as string, 
      APPOINTMENT_COLLECTION_ID as string, 
      [Query.orderDesc("$createdAt")]
     
    )

Here I am Fetching my appoitments data but it is showing a fake document

Here I am Logging the count of the document

// Logging the documents length 
    console.log(appointments.documents.length

output:

admin

instead fetching the new documents it fetches and gives old document

👍 Expected behavior

I Need to fetch new document

👎 Actual Behavior

It fetches old document

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Windows

🧱 Your Environment

Nextjs

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@theTechbug
Copy link

I will try to fix this issue.

@Pheeleex
Copy link

I had a similar issue, i changed [Query.orderDesc("$createdAt")] created at to [Query.orderDesc("$id")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants