-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace usage of deprecated collection.count() with collection.countDocuments() [DATAMONGO-2059] #2925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Mark Paluch commented This is a known issue and we spiked on possible ways how to address MongoDB's behavior. Right now we're recommending to use |
Doron Levari commented We are getting KILLED by Mongo 4.0 doing count instead of countDocuments. We are already using 2.2.4. Any chance this can backport to 2.2.X? Any workaround you may think of until 3.0 gets out? When is that planned? Thanks!! See below a slow q log from Mongo, stupid count, there are 7 docs in the "device" collection... 7!!! (2 are configState: "NOT_SYNCED") and the count takes 97 seconds because of "schemaLock"... Please help!! 2020-03-05T14:14:48.589+0000 I COMMAND [conn2198692] command XYZ.device command: count { count: "device", query: { configState: "NOT_SYNCED" }, $db: "XYZ", $clusterTime: { clusterTime: Timestamp(1583417583, 16), signature: { hash: BinData(0, 09E81DF60CD75D49362F7838374CE05FF94C82A6), keyId: 6753496676054335795 } }, lsid: { id: UUID("25508109-bce4-4554-af76-5fd3cc099052") } } planSummary: COUNT_SCAN { configState: 1 } keysExamined:1 docsExamined:0 numYields:0 reslen:170 locks:{ Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } storage:{ timeWaitingMicros: { handleLock: 14705, schemaLock: 97085560 } } protocol:op_msg 97101ms
|
Christoph Strobl commented Please find planned release dates in our wiki or the Spring Calendar. |
$near and $nearSphere queries are not supported via countDocuments and the used aggregation match stage and need to be rewritten to $geoWithin. The existing logic did not cover usage of geoJson types, which is fixed now. In case of nearSphere it is also required to convert the $maxDistance argument (given in meters for geoJson) to radians which is used by $geoWithin $centerSphere. Related to #2925
$near and $nearSphere queries are not supported via countDocuments and the used aggregation match stage and need to be rewritten to $geoWithin. The existing logic did not cover usage of geoJson types, which is fixed now. In case of nearSphere it is also required to convert the $maxDistance argument (given in meters for geoJson) to radians which is used by $geoWithin $centerSphere. Closes #4004 Original pull request: #4006. Related to #2925
$near and $nearSphere queries are not supported via countDocuments and the used aggregation match stage and need to be rewritten to $geoWithin. The existing logic did not cover usage of geoJson types, which is fixed now. In case of nearSphere it is also required to convert the $maxDistance argument (given in meters for geoJson) to radians which is used by $geoWithin $centerSphere. Closes #4004 Original pull request: #4006. Related to #2925
Christoph Strobl opened DATAMONGO-2059 and commented
fails with
we need to switch over to
$geoWithin
using$center
Reference URL: https://jira.mongodb.org/browse/DRIVERS-518
Issue Links:
Referenced from: pull request #604
The text was updated successfully, but these errors were encountered: