2 Replies Latest reply on Feb 10, 2014 9:37 PM by Ramesh Reddy

    MongoDB: A few schema configuration questions

    Assaf Broitman Newbie

      Hi,

       

      Based on: MongoDB Translator - Teiid 8.7 (draft) - Project Documentation Editor I'm attempting to configure an existing document schema that includes the below Jason documents.

      A few questions:

      1. Nested documents - I see nesting is supported but require a reference to the parent ID. If my documents do not have this parent ID, is there still a way to map it? (in our example below, map casePhoneNumbers
      2. Geospatial data - Does the translator support geo location data? And as above, how should it be configured without the parent ID?

       

      Thanks,

      Assaf

       

      {

          "_id" : ObjectId("52d4cb79f98a50a2904e5234"),

          "CaseId" : "67b4ad22-7ef1-4218-b56c-95ee5fa73fea",

          "CaseAddressString" : "223 Maple Street, Goldfield",

          "CaseOpenDatetime" : ISODate("2014-01-10T05:28:47.546Z"),

          "CaseBeginDatetime" : ISODate("2014-01-12T05:28:47.546Z"),

          "CaseDescription" : "Dolore incididunt commodo enim in consequat et labore nostrud magna occaecat nulla non consectetur est.",

          "RequestorFirstName" : "Joyner",

          "RequestorLastName" : "Dale",

          "age" : 37,

          "gender" : "male",

          "CasePhoneNumbers" : [

              {

                  "type" : "home",

                  "number" : "+1 (955) 555-3257"

              },

              {

                  "type" : "fax",

                  "number" : "+1 (940) 557-2180"

              }

          ],

          "location" : [

              -122.405772,

              37.619449

          ],

          "ServiceName" : "Other",

          "CaseCurrentStatusDatetime" : Date(-9223372036854775808)

      }

        • 1. Re: MongoDB: A few schema configuration questions
          Ramesh Reddy Master

          Assaf,

           

          1. Nested documents - I see nesting is supported but require a reference to the parent ID. If my documents do not have this parent ID, is there still a way to map it? (in our example below, map casePhoneNumbers

          Unfortunately Yes, it does require a parent ID, also it requires in the DBRef format. Like this

           

          {
            "_id" : "1002",
            "first_name" : "John",
            "last_name" : "Doe",
            "Address" : {
                  "street" : "123 Main St",
                  "city"  : "Chicago",
                  "state" : "IL",
                  "zipcode" : "60659",
                  "_id" : DBRef("Customer", "1002")
            }
          }
          

           

          As I mentioned on the document, it is harder for existing documents to map to use translator with out some amount of re-work to data or re-write using the Teiid. The translator requires the documents to be in certain format so that it can generate queries effectively from SQL.

           

          Right now the "location" will also be an issue, as we have not added "Array" support. If you want you can open a JIRA for support of this.

           

          Geospatial data support is also lacking in current version, you can certainly add JIRA for this too.

           

          Sorry could not be much help.

           

          Ramesh..