Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-600

Unrecognized command: $query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.1
    • Affects Version/s: 1.6
    • Component/s: None
    • None

      Thanks for the response

      Error message

      QueryFailure flag was unrecognized command: $query (response was { "$err" : "unrecognized command: $query", "code" : 13390 }).

      Stacktrace

         at MongoDB.Driver.Internal.MongoReplyMessage`1.ReadFrom(BsonBuffer buffer, IBsonSerializationOptions serializationOptions) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Internal\MongoReplyMessage.cs:line 99
         at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializationOptions serializationOptions) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Internal\MongoConnection.cs:line 475
         at MongoDB.Driver.MongoCursorEnumerator`1.GetReply(MongoConnection connection, MongoRequestMessage message) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCursorEnumerator.cs:line 296
         at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCursorEnumerator.cs:line 253
         at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCursorEnumerator.cs:line 141
         at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
         at MongoDB.Driver.MongoCollection.FindOneAs[TDocument](IMongoQuery query) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCollection.cs:line 557
         at MongoDB.Driver.MongoCollection`1.FindOne(IMongoQuery query) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCollection.cs:line 1734
         at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoDatabase.cs:line 973
         at MongoDB.Driver.MongoDatabase.RunCommandAs[TCommandResult](IMongoCommand command) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoDatabase.cs:line 950
         at MongoDB.Driver.MongoCollection.Aggregate(IEnumerable`1 operations) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCollection.cs:line 124
         at MongoDB.Driver.MongoCollection.Aggregate(BsonDocument[] operations) in D:\Temp\mongodb-code\mongodb-mongo-csharp-driver-98a0129\Driver\Core\MongoCollection.cs:line 134
         at TopSecretProject;).Service.Internal.AggregateFramework.BaseAggregateFrameworkMongoMentionService.GetAggregateResult(MentionAggregateQuery query, MongoField groupingKey, IDictionary`2 includeAggregateFields, BsonDocument[]& commands, Boolean isTimeSeries) in D:\Projects\TopSecretProject;)\Service\Internal\AggregateFramework\BaseAggregateFrameworkMongoMentionService.cs:line 50
         at TopSecretProject;).Service.Internal.AggregateFramework.AggregateFrameworkMongoMentionService.GetTopItemResults(MentionAggregateQuery query, IDictionary`2 includeAggregateFields) in D:\Projects\TopSecretProject;)\Service\Internal\AggregateFramework\AggregateFrameworkMongoMentionService.cs:line 22
      

      Environment:

      MongoDB.Driver: C# 1.6.1.20900
      MongoDB.Bson: C# 1.6.1.20899
      Mongos: 2.07
      - 1 master set (3 shards) 2.07
      - 1 slave set (3 shards) 2.2
      connectionString: mongodb://mongos-version-2.0.7-ip:port/?readPreference=secondaryPreferred
      

      We could not upgrade master & mongos to 2.2 atm so we have to try this approach as it's mentioned in the doc.
      However, if I setup another mongos 2.2, there is not any error but the aggregate result is always empty. I tried to run the same aggregate commands using script against every single shard then it's good. Anyway, this could be another issue.

      Cheers

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: