Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3316

MongoDB: Getting "unrecognized field \"cursor" when connecting to MongoDB 2.4.8 using Teiid 8.9.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.10
    • 8.9.1
    • Misc. Connectors
    • Hide

      Import this JSON File:

      {
      "BackupType" : "DBBackup",
      "Date" : "29-1-2015",
      "test": [{
      "TeiidArray": [
      { "_id":

      { "$oid" : "541087c3f706400030000002" }

      ,
      "FirstName": "Eugene",
      "Score": [ "Korean", "100", "Medium" ],
      "LastName": "T",
      "CustomerID": 1 },
      { "_id":

      { "$oid" : "541089051c4d5a0030000001" }

      ,
      "FirstName": "Stas",
      "Score": [ "Japanese", "50", "Advance" ],
      "LastName": "C",
      "CustomerID": 2 },
      { "_id":

      { "$oid" : "5410c969516cd50064000001" }

      ,
      "FirstName": "Sally",
      "Score": [ "Russian", "90", "Advance" ],
      "LastName": "F",
      "CustomerID": 3 } ]}]}

      Create Schema like:

      CREATE FOREIGN TABLE TeiidArray (
      ID String PRIMARY KEY,
      FirstName varchar(25),
      LastName varchar(25),
      Score object[]
      ) OPTIONS(UPDATABLE 'TRUE');

      Run the following sql:

      select "FirstName" from "MongoDB_Donetsk_Array"."TeiidArray" limit 1000

      Show
      Import this JSON File: { "BackupType" : "DBBackup", "Date" : "29-1-2015", "test": [{ "TeiidArray": [ { "_id": { "$oid" : "541087c3f706400030000002" } , "FirstName": "Eugene", "Score": [ "Korean", "100", "Medium" ], "LastName": "T", "CustomerID": 1 }, { "_id": { "$oid" : "541089051c4d5a0030000001" } , "FirstName": "Stas", "Score": [ "Japanese", "50", "Advance" ], "LastName": "C", "CustomerID": 2 }, { "_id": { "$oid" : "5410c969516cd50064000001" } , "FirstName": "Sally", "Score": [ "Russian", "90", "Advance" ], "LastName": "F", "CustomerID": 3 } ]}]} Create Schema like: CREATE FOREIGN TABLE TeiidArray ( ID String PRIMARY KEY, FirstName varchar(25), LastName varchar(25), Score object[] ) OPTIONS(UPDATABLE 'TRUE'); Run the following sql: select "FirstName" from "MongoDB_Donetsk_Array"."TeiidArray" limit 1000

      I am getting the following erroe when connecting to MongoDB using Teiid 8.9.1:

      Caused by: com.mongodb.CommandFailureException:

      { "serverUsed" : "donetsk:27017" , "ok" : 0.0 , "errmsg" : "unrecognized field \"cursor"}

      at com.mongodb.CommandResult.getException(CommandResult.java:76)

      at com.mongodb.CommandResult.throwOnError(CommandResult.java:131)

      at com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:100)

      at com.mongodb.DBCollection.aggregate(DBCollection.java:1571)

      at org.teiid.translator.mongodb.MongoDBQueryExecution.execute(MongoDBQueryExecution.java:111)

              rhn-engineering-rareddy Ramesh Reddy
              mchantibco Ivan Chan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: