Uploaded image for project: 'MongoDB for IntelliJ Plugin'
  1. MongoDB for IntelliJ Plugin
  2. INTELLIJ-235

java parser does not understand .iterator calls

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 1
    • Iteration Wormhole, Iteration X-Ray
    • Not Needed
    • Developer Tools

      Problem Statement/Rationale

      java parser does not understand .iterator calls

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      It seems that using

      .find.iterator()

      returns a MongoCursor which does not implement MongoIterable. Because the plugin can not detect what type of operation it's doing, it discards the query.

      Steps to Reproduce

      private MongoCursor<Document> getArtworkByDepartmentAndArtist(String department, String artist) {
          return getCollection().find(Filters.and(
            Filters.eq("Department", department),
            Filters.eq("Artist", artist)
          )).iterator();
        }
      

      Expected Results

      It should detect the query as a FIND_MANY so we run our linters and can generate a query.

      Actual Results

      It's categorised as UNKNOWN.

      Additional Notes

            Assignee:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Reporter:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: