[SERVER-34992] FieldPath field names may not start with '$'. Created: 15/May/18  Updated: 28/Jun/18  Resolved: 21/May/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Diego Daibert Assignee: Ramon Fernandez Marina
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-14466 Support projecting the $id or $ref fo... Closed
Operating System: ALL
Steps To Reproduce:

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.

Participants:

 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.



 Comments   
Comment by Ramon Fernandez Marina [ 21/May/18 ]

I believe this is the same issue described in SERVER-14466 and other duplicate tickets linked to it, so I'm going to mark this ticket as a duplicate. If you believe this is incorrect, please send the aggregation pipeline that triggers this error so we can take a closer look.

Regards,
Ramón.

Generated at Thu Feb 08 04:38:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.