Roelof Coster
Roelof Coster

Reputation: 23

Not primary error writing data frame to MongoDB

I cannot write any data to my MongoDB using R mongolite. I consistently get: Error: not primary error.

collection <- mongolite::mongo(url=my_url, db=my_db, collection=my_collection)
collection$insert(iris)

Error: not primary

This Error: not primary message occurs whatever I try to insert.

The database works fine, as I can write to it using Python without any problems.

I would appreciate any help!

Upvotes: 0

Views: 233

Answers (0)

Related Questions