[GODRIVER-1016] Get current op on MongoDB 2.6 Created: 03/May/19  Updated: 28/Oct/23  Resolved: 05/Jun/19

Status: Closed
Project: Go Driver
Component/s: Administrative Commands
Affects Version/s: 1.0.1
Fix Version/s: 1.0.3

Type: Bug Priority: Minor - P4
Reporter: Pierre Durand Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Linux
MongoDB: 2.6


Attachments: File mgocurrentop.go     File mongocurrentop.go    
Issue Links:
Backports
backported by GODRIVER-1112 backport "Get current op on MongoDB 2.6" Closed

 Description   

I'm migrating a MongoDB monitoring tool from mgo to new official mongo driver.

One of my MongoDB version uses the version 2.6 (yes I know, it's very old, and my team is migrating it)

In my code, I'm doing a "find one" query on the "$cmd.sys.inprog" collection.

With the old mgo library, it was working fine. With the official mongo driver, it returns an error message:

query failure: {"$err": "bad numberToReturn (0) for $cmd type ns - can only be 1 or -1","code": {"$numberInt":"16978"}}

I provided in attachment my old and new code.

Any idea ?



 Comments   
Comment by Pierre Durand [ 06/Jun/19 ]

Thank you for the fix, I'll test tomorrow ! 

Comment by Githook User [ 29/May/19 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: Change Find and FindOne to use FindOperation

GODRIVER-1070
GODRIVER-1016

Change-Id: I1ab89cc11921e1d3158f263dbe19b24f1ca2de9e
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/5fc39da6b947e5a2df3ff79991d5c490d04721f8

Comment by Divjot Arora (Inactive) [ 24/May/19 ]

CR: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/455709

Comment by Ian Whalen (Inactive) [ 23/May/19 ]

note to implementer: we should set a limit of -1 when doing a findOne. this will likely happen in GODRIVER-1070.

Generated at Thu Feb 08 08:35:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.