Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
60 views

The timeCodec in the Mongo driver throws an error when decoding doubles into time.Time fields. I'm dealing with legacy data that stores time as a double and it's impractical for me to migrate ...
takanuva15's user avatar
  • 1,790
1 vote
1 answer
99 views

I’m using MongoDB GoLang Driver v2 and I want to store a custom money type in MongoDB. If the value is nil, I want the BSON document to store price: null. Example document I want: { "name":...
Prakash P's user avatar
  • 4,138
3 votes
2 answers
157 views

I'm encountering an issue in a Go application that uses the official MongoDB Go driver. We have the use case where a ReplicaSet is recreated from scratch. Replica Set consists of 2 members, no arbiter ...
Isaac's user avatar
  • 31
-1 votes
1 answer
90 views

In our Go codebase, we’re building dynamic projection maps for queries. Instead of using map[string]int{"name": 1}, we’re considering using map[string]bool{"name": true} for ...
Aadi Sharma's user avatar
1 vote
2 answers
80 views

When I try to query to collection using ObjectID, I got no documents. objID, err := primitive.ObjectIDFromHex("6812a288d8169501c71c69b2") if err != nil { return domain.User{}, ...
Call_Me_Mr_P's user avatar
0 votes
2 answers
113 views

I have been running into some issues when writing a few units tests. When the method has a transaction it just hangs and eventually times outs. I have been trying to figure how I can mock the ...
Mike3355's user avatar
  • 12.2k
1 vote
1 answer
75 views

I have built a REST API that have a Mongo database to persist data. I ran a simple load test to measure how the API behaves to 100 requests per seconds in a infinite period of time. As the test goes I ...
Daniel Luis's user avatar
2 votes
1 answer
83 views

I am trying to add a userID to a likes field in MongoDB. This field will be an array of strings []string . It is currently null, but that should not be an issue since was using "$set". I ...
Mike3355's user avatar
  • 12.2k
2 votes
1 answer
95 views

I'm parsing BSON from strings using the mongo driver library. AFAIK, the following should be valid BSON: { "createdAt": {"$date": "2024-01-01T00:00:00.000Z"} } but the ...
AleG's user avatar
  • 150
1 vote
0 answers
34 views

I have a small go utility that lets me specify a connection and databases and an aggregation file that lets me run the aggregation pipeline against the specified databases. The heart of it is ...
Pete McKinney's user avatar
2 votes
1 answer
192 views

I'm building a Go application deployed on Kubernetes that uses MongoDB as the database. Currently, my application includes logic to create indexes on collections during every pod startup. While this ...
Zoha Behnam's user avatar
1 vote
1 answer
63 views

I've got a database with some legacy data where some of the documents store the field "createdDate" as a normal bson date, but others store the field as an epoch millisecond timestamp with ...
takanuva15's user avatar
  • 1,790
1 vote
0 answers
54 views

I want an use case that receive a list of string (represent for ObjectID hex) and I want to build a struct using binding tag to validate: If receiving one, we could use: type SingleID struct { ...
SirT's user avatar
  • 71
1 vote
1 answer
1k views

In my Golang project I need to mock mongodb to be able to write unit tests for my Repository functions. I mostly need to mock collection.Indexes.CreateMany or FindOneAndUpdateor Find or cursor.All or ...
ns.altun's user avatar
  • 180
1 vote
1 answer
94 views

I'm experiencing an issue with MongoDB and Docker when deploying to Digital Ocean App Platform from Docker Hub. Here is the error output from the console: server selection error: server selection ...
Gustavo Fernando Quintana's user avatar

15 30 50 per page
1
2 3 4 5
119