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

Support $currentDate field update operator #622

Closed
Tracked by #229
AlekSi opened this issue May 23, 2022 · 0 comments · Fixed by #662 or #701
Closed
Tracked by #229

Support $currentDate field update operator #622

AlekSi opened this issue May 23, 2022 · 0 comments · Fixed by #662 or #701
Assignees
Labels
code/feature Some user-visible feature is not implemented yet
Milestone

Comments

@AlekSi
Copy link
Member

AlekSi commented May 23, 2022

Dot notation is not in scope. Use UnimplementedDot if available.

In a separate PR, timestamp:

"Timestamp": {
        id:     "double",
	update: bson.D{{"$currentDate", bson.D{{"value", bson.D{{"$type", "timestamp"}}}}}},
	stat: &mongo.UpdateResult{
		MatchedCount:  1,
		ModifiedCount: 1,
		UpsertedCount: 0,
	},
        result: bson.D{{"_id", "double"}, {"value", nowTimestamp}},
},

where

nowTimestamp := primitive.Timestamp{T: uint32(time.Now().UTC().Unix()), I: uint32(0)}
@AlekSi AlekSi added the code/feature Some user-visible feature is not implemented yet label May 23, 2022
@AlekSi AlekSi added this to the v0.3.1 milestone Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
None yet
2 participants