skip to content
Alvin Lucillo

Filter with empty date

/ 1 min read

💻 Tech

To find documents with empty date like 0001-01-01T00:00:00.000+00:00 in MongoDB with go.mongodb.org Go package:

collection.FindOne(ctx, map[string]string{"somedatefield": time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)})