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: _createdAt and _updatedAt added to nested document #5999

Closed
2 tasks done
fanatic75 opened this issue Aug 16, 2023 · 0 comments
Closed
2 tasks done

🐛 Bug Report: _createdAt and _updatedAt added to nested document #5999

fanatic75 opened this issue Aug 16, 2023 · 0 comments
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@fanatic75
Copy link
Contributor

fanatic75 commented Aug 16, 2023

👟 Reproduction steps

Assuming we have 2 level one to one two way relationship

Level 1 <> Level 2

database.updateDocument('level1', 'level1a', {
 "title" : "new value",
  "level2": {
    "$id": "level2a",
    "rating":"10"
    
  }

});

results with _createdAt and _updatedAt keys

{
    "$id": "level1a",
    "$createdAt": "2023-08-15T00:50:55.532+00:00",
    "$updatedAt": "2023-08-15T01:07:00.060+00:00",
    "$permissions": [],
    "level2": {
        "_createdAt": null,
        "_updatedAt": null,
        "text": null,
        "$id": "level2a",
        "$permissions": [],
        "$databaseId": "one-to-one",
        "$collectionId": "level2"
    },
    "$databaseId": "one-to-one",
    "$collectionId": "level1"
}

👍 Expected behavior

Resulting document should not contain _createdAt and _updatedAt and values should not be null.
It should be like this

{
    "$id": "level1a",
    "$createdAt": "2023-08-15T00:50:55.532+00:00",
    "$updatedAt": "2023-08-15T01:07:00.060+00:00",
    "$permissions": [],
    "level2": {

    "$createdAt": "2023-08-15T00:50:55.532+00:00",
    "$updatedAt": "2023-08-15T01:07:00.060+00:00",
        "text": null,
        "$id": "level2a",
        "$permissions": [],
        "$databaseId": "one-to-one",
        "$collectionId": "level2"
    },
    "$databaseId": "one-to-one",
    "$collectionId": "level1"
}

👎 Actual Behavior

Currently we are getting _createdAt and _updatedAt

{
    "$id": "level1a",
    "$createdAt": "2023-08-15T00:50:55.532+00:00",
    "$updatedAt": "2023-08-15T01:07:00.060+00:00",
    "$permissions": [],
    "level2": {
        "_createdAt": null,
        "_updatedAt": null,
        "text": null,
        "$id": "level2a",
        "$permissions": [],
        "$databaseId": "one-to-one",
        "$collectionId": "level2"
    },
    "$databaseId": "one-to-one",
    "$collectionId": "level1"
}

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

MacOS

🧱 Your Environment

Running in local hosted appwrite with 1.4.x

👀 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?

@fanatic75 fanatic75 added the bug Something isn't working label Aug 16, 2023
@fanatic75 fanatic75 added the product / databases Fixes and upgrades for the Appwrite Database. label Aug 16, 2023
@stnguyen90 stnguyen90 changed the title 🐛 Bug Report: 🐛 Bug Report: _createdAt and _updatedAt added to nested document Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

1 participant