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

Remove Now from index bindings #74

Closed
ptpaterson opened this issue Jun 30, 2021 · 2 comments
Closed

Remove Now from index bindings #74

ptpaterson opened this issue Jun 30, 2021 · 2 comments

Comments

@ptpaterson
Copy link

Now is not permitted within index bindings. There is disclaimer that the result will not be what is intended, but in fact using Now can cause a runtime error that prevents the index from ever completing.

// DISCLAIMER !!!!
// Now() should not be used in bindings since it does not provide correct results,
// Something I did not know at the time of writing.
// Instead please use either a created_at time you store on the document
// or an updated time instead. We'll update the app from the moment I find time to test
// an alternative approach.
txtime: Now(),

Fweets should have a created_at field that can be referred to in the index binding. This is also more correct anyway, since created_at timestamp is better to use than the latest updated time stamp.

@github-actions
Copy link

Internal ticket number is LABS-24

@ptpaterson
Copy link
Author

Fweets are created with a created field set to Now(). Updating the index bindings to Select(["data", "created"], Var("fweet")) looks like it should resolve things.

created: Now()

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

2 participants