-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.0.4
-
Component/s: CRUD
-
Labels:None
-
Environment:AKS
Kubernetes 1.12
MongoDB 4.0.9
I deploy MongoDB replicaset with single endpoint. Want to test connection using simple code to write but write failed by returns '(NotMaster) not master' when i tried to connect to MongoDB using URI "mongodb://serverIP:27017/admin?connect=direct"
```
rows := db.Database("tester").Collection("test1")
cursor, err := rows.InsertOne(context.TODO(), json)
if err != nil
id := cursor.InsertedID
```
return message:
```
2019/07/26 13:21:40 (NotMaster) not master
```
But when i create similar function to insert using pymongo, connect using same URI it returns 'no master' for a couple second and then works fine.
```
result = col_ready.insert_one(post).acknowledged
logger("> {1}".format(i, result))
time.sleep(1)
```
return message:
```
2019-07-26 13:25:01,366 not master
2019-07-26 13:25:02,704 > True
```
Did i miss something?