Cursor.count() - Wrong default value for applySkipLimit when used with promises

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Minor - P4
    • None
    • Affects Version/s: 3.4.1
    • Component/s: None
    • None
    • Not Needed
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Hi after some tests and review code.

      I figured out that default value for applySkipLimit is false when using with Promise.

      applySkipLimit is set to true only if the given parameter is a function.
      If no parameter is provided (no callback, returning Promise) applySkipLimit is equal to undefined which is a falsy value.

      // file lib/cursor.js line 821
      if (typeof applySkipLimit === 'function') {
            callback = applySkipLimit;
            applySkipLimit = true;
      }
      

              Assignee:
              Unassigned
              Reporter:
              Antoine Caron
              None
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: