Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-2170

IndexInfo.partialFilterExpression should be null (not an empty String) when undefined

    XMLWordPrintable

    Details

      Description

      In a persistence test, I check whether a MongoDB index has been correctly initialized. For this purpose, I like to use the IndexInfo class and its equals-method. But this does not work currently, because the expected index created by me has a partialFilterExpression of null, but the actual one loaded from MongoDB has a partialFilterExpression of "". As a workaround, I now compare field by field, ignoring partialFilterExpression.

      I would suggest to set partialFilterExpression to null (instead of "") when it is not defined by the MongoDB index.

      This is the affected line of code: IndexInfo.java#L111

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            danielfesenmeyer danielFesenmeyer
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: