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

Field with timetamp: "createdAt" not set on newly inserted document #245

Closed
leggetter opened this issue Feb 22, 2023 · 6 comments · Fixed by #303
Closed

Field with timetamp: "createdAt" not set on newly inserted document #245

leggetter opened this issue Feb 22, 2023 · 6 comments · Fixed by #303

Comments

@leggetter
Copy link
Contributor

Given the following data model:

@TigrisCollection("posts")
class Post {
  @PrimaryKey(TigrisDataTypes.INT64, { order: 1, autoGenerate: true })
  id?: string;

  @Field()
  username!: string;

  @Field()
  text!: string;

  @Field(TigrisDataTypes.DATE_TIME, { timestamp: "createdAt" })
  createdAt?: Date;
}

export default Post;

And this code to insert a new User:

const post = await postsCollection.insertOne({ username: defaultUser.username, text: input.text })
console.log('new post on server', post);

Any ideas why the result of the console.log doesn't show a createdAt property on the newly created Post?

new post on server {
  username: 'leggetter',
  text: 'this is another post test',
  id: '1677074700254010134'
}

Note that the document does have a createdAt value when viewed in the web console and also when retrieving it via a query. It just seems to be a problem with the initial insertOne.

From @JigarJoshi :

raw response doesn't contain the entire payload. it contains some field and client stitches them together to form the inserted document. It needs to be fixed for TS client here.

@ovaistariq
Copy link
Contributor

/bounty 100

@algora-pbc
Copy link

algora-pbc bot commented Apr 11, 2023

💎 $100.00 bounty created by ovaistariq
👉 To claim this bounty, submit a pull request that includes the text /claim #245 somewhere in its body
📝 To receive payouts, join Algora and complete the relevant onboarding steps
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to tigrisdata/tigris-client-ts!

@algora-pbc
Copy link

algora-pbc bot commented Apr 14, 2023

💡 akhill10 submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

@algora-pbc
Copy link

algora-pbc bot commented Apr 14, 2023

🎉🎈 @akhill10 has been awarded $100.00! 🎈🎊

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-beta.45 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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