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

Supports for constant functions that generate field names

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 8
    • Not Needed
    • Developer Tools

      In MMS is typical to do this:
       
      final Bson query =
      eq(joinFields(POLICY_ASSIGNMENTS, PolicyAssignment.FieldDefs.SCOPE_FIELD), resourceId);
       
      Where join fields, just concatenates them using String.join
       
      public static String joinFields(final String... pFields)

      { return String.join(".", pFields); }

       
      Currently we don't detect the field name because we consider it calculated at runtime, but we could infer the name if we know that String.join is a pure function, so joinFields is also pure, and all parameters are final strings.

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

              Created:
              Updated: