Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34992

FieldPath field names may not start with '$'.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Create a MongoDB using Morphia framework and use DBReference in some fields.

      Try to connect this database to Tableau and map an aggregation with two tables. Or try to use the aggregation framework without Morphia.

      Show
      Create a MongoDB using Morphia framework and use DBReference in some fields. Try to connect this database to Tableau and map an aggregation with two tables. Or try to use the aggregation framework without Morphia.

      Description

      I connected Tableau with success on my MongoDB database, but when I tried to join two tables, how I use DBReferences (Morphia framework on my Java project), some fields have this format: company.$id or company.$ref, and when I try to get the query result, I receive this message:

      [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.12 mongosqld v2.4.1]failed to execute aggregate: (Location16410) FieldPath field names may not start with '$'.
      Unable to create extract
      SELECT `Vulnerability`.`_id` AS `_id (Vulnerability)`,
       `Target`.`_id` AS `_id`,
       `Vulnerability`.`active` AS `active (Vulnerability)`,
       `Target`.`active` AS `active`,
       `Vulnerability`.`changedDate` AS `changedDate`,
       `Vulnerability`.`company.$id` AS `company.$id (Vulnerability)`,
       `Target`.`company.$id` AS `company.$id`,
       `Vulnerability`.`company.$ref` AS `company.$ref (Vulnerability)`,
       `Target`.`company.$ref` AS `company.$ref`,
       `Vulnerability`.`count` AS `count`,
       `Vulnerability`.`createDate` AS `createDate`,
       `Target`.`creationDate` AS `creationDate`,
       `Vulnerability`.`cvssV3.accessComplexity` AS `cvssV3.accessComplexity`,
       `Vulnerability`.`cvssV3.atackVector` AS `cvssV3.atackVector`,
       `Vulnerability`.`cvssV3.confidenciality` AS `cvssV3.confidenciality`,
       `Vulnerability`.`cvssV3.cvssScore` AS `cvssV3.cvssScore`,
       `Vulnerability`.`cvssV3.disponibility` AS `cvssV3.disponibility`,
       `Vulnerability`.`cvssV3.impact` AS `cvssV3.impact`,
       `Vulnerability`.`cvssV3.integrity` AS `cvssV3.integrity`,
       `Vulnerability`.`cvssV3.privilege` AS `cvssV3.privilege`,
       `Vulnerability`.`cvssV3.probability` AS `cvssV3.probability`,
       `Vulnerability`.`cvssV3.scopeMutable` AS `cvssV3.scopeMutable`,
       `Vulnerability`.`cvssV3.userInteraction` AS `cvssV3.userInteraction`,
       `Vulnerability`.`detail.en` AS `detail.en`,
       `Vulnerability`.`detail.es` AS `detail.es`,
       `Vulnerability`.`detail.pt` AS `detail.pt`,
       `Target`.`hostname` AS `hostname`,
       `Vulnerability`.`idGat` AS `idGat`,
       `Target`.`ipNumber` AS `ipNumber`,
       `Target`.`ip` AS `ip`,
       `Vulnerability`.`kb.$id` AS `kb.$id`,
       `Vulnerability`.`kb.$ref` AS `kb.$ref`,
       `Vulnerability`.`lastSeenDate` AS `lastSeenDate`,
       `Vulnerability`.`name.en` AS `name.en`,
       `Vulnerability`.`name.es` AS `name.es`,
       `Vulnerability`.`name.pt` AS `name.pt`,
       `Target`.`netbios` AS `netbios`,
       `Vulnerability`.`oldStatus` AS `oldStatus`,
       `Target`.`os` AS `os`,
       `Vulnerability`.`port` AS `port`,
       `Vulnerability`.`protocol` AS `protocol`,
       `Vulnerability`.`risk` AS `risk (Vulnerability)`,
       `Target`.`risk` AS `risk`,
       `Vulnerability`.`rootCause.$id` AS `rootCause.$id`,
       `Vulnerability`.`rootCause.$ref` AS `rootCause.$ref`,
       `Target`.`score` AS `score`,
       `Vulnerability`.`sourceScan` AS `sourceScan`,
       `Vulnerability`.`source` AS `source`,
       `Vulnerability`.`status` AS `status`,
       `Vulnerability`.`svcName` AS `svcName`,
       `Vulnerability`.`target.$id` AS `target.$id`,
       `Vulnerability`.`target.$ref` AS `target.$ref`,
       `Target`.`type` AS `type`,
       `Vulnerability`.`underAnalysis` AS `underAnalysis`,
       `Vulnerability`.`unmapped` AS `unmapped`,
       `Vulnerability`.`version` AS `version`
      FROM `Target`
       INNER JOIN `Vulnerability` ON (`Target`.`_id` = `Vulnerability`.`target.$id`)
      LIMIT 1000

      I renamed the name fields too, but nothing changes. I opened an Issue on Tableau support too and They suggested me contact you to solve this problem, because they can't. My MongoDB version is v3.4.9.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: