Error: TypeError: err.hasWriteErrors is not a function : DBCollection.prototype.updateMany@src/mongo/shell/crud_api.js:629:13 @(shell):1:1
I'm facing this issue to run the Mongo query for updating item collection in Azure CosmosDB.
I am also having this issue. Did you find a solution?
I haven't find any solution for this yet.
I connected via mongo shell and the query worked fine...so seems to be a problem with Robo 3T
I did the same by connecting to mongodb via mongo shell
2018-09-24T19:30:58.507-0700 E QUERY [js] WriteCommandError: Message: {"Error
s":["Request rate is large"]}
ActivityId: 021b1ecb-0000-0000-0000-000000000000, Request URI: /apps/fdd31784-70
ac-4bdd-b379-098c33c600e2/services/9f9391e5-5946-47af-8c1f-7f84c3aa802f/partitio
ns/2fcc9387-89e7-4f52-8e94-6aaa611c7b37/replicas/131806389884591897p, RequestSta
ts:
RequestStartTime: 2018-09-25T02:30:58.5164164Z, Number of regions attempted: 1
, SDK: Microsoft.Azure.Documents.Common/2.0.0.0 :
WriteCommandError({
"_t" : "OKMongoResponse",
"ok" : 0,
"code" : 16500,
"errmsg" : "Message: {"Errors":["Request rate is large"]}rnActivit
yId: 021b1ecb-0000-0000-0000-000000000000, Request URI: /apps/fdd31784-70ac-4bdd
-b379-098c33c600e2/services/9f9391e5-5946-47af-8c1f-7f84c3aa802f/partitions/2fcc
9387-89e7-4f52-8e94-6aaa611c7b37/replicas/131806389884591897p, RequestStats: r
nRequestStartTime: 2018-09-25T02:30:58.5164164Z, Number of regions attempted: 1
rn, SDK: Microsoft.Azure.Documents.Common/2.0.0.0",
"$err" : "Message: {"Errors":["Request rate is large"]}rnActivityI
d: 021b1ecb-0000-0000-0000-000000000000, Request URI: /apps/fdd31784-70ac-4bdd-b
379-098c33c600e2/services/9f9391e5-5946-47af-8c1f-7f84c3aa802f/partitions/2fcc93
87-89e7-4f52-8e94-6aaa611c7b37/replicas/131806389884591897p, RequestStats: rnR
equestStartTime: 2018-09-25T02:30:58.5164164Z, Number of regions attempted: 1r
n, SDK: Microsoft.Azure.Documents.Common/2.0.0.0"
})
WriteCommandError@src/mongo/shell/bulk_api.js:420:48
Bulk/executeBatch@src/mongo/shell/bulk_api.js:902:1
Bulk/this.execute@src/mongo/shell/bulk_api.js:1150:21
DBCollection.prototype.updateMany@src/mongo/shell/crud_api.js:655:17
@(shell):1:1
I'm having exactly the same problem, and the same result as @pragathikadaganchi using the shell. I believe it's not 3T related.
I had this issue recently in Robo3T. The reason was that I was connected to a secondary server, which I could not write to. An edit in the UI gave a better error message. But, an updateMany query resulted in the hasWriteErrors error.
I was able to resolve by connecting to the primary and rerunning the query. I can see why this might not happen in the console, as that might be smarter when connecting to the replica set and choosing the primary for the write operation.
I had same issue with, I was trying to schedule mongo update query using shall script with .js script. the query was running fine when tried with Robo 3T and from mongo shall but was not running using shall script.
it was below error 馃挴
Error: TypeError: err.hasWriteErrors is not a function : DBCollection.prototype.updateMany@src/mongo/shell/crud_api.js:629:13 @(shell):1:1
using load function it has been resolved.
Seems like a read/write permission issue rather than Robo. Closing. Feel free to re-open in any case.
Most helpful comment
I had this issue recently in Robo3T. The reason was that I was connected to a secondary server, which I could not write to. An edit in the UI gave a better error message. But, an updateMany query resulted in the hasWriteErrors error.
I was able to resolve by connecting to the primary and rerunning the query. I can see why this might not happen in the console, as that might be smarter when connecting to the replica set and choosing the primary for the write operation.