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

Creating capped collection with CollectionOptions.empty().capped(…) causes NPE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0 M2 (Kay)
    • Fix Version/s: 2.0 M4 (Kay)
    • Component/s: Core
    • Labels:
      None

      Description

      NPE is thrown when attempting to create a collection without collation

      Code

      blockingMongo.createCollection(LoginEvent.class, CollectionOptions.empty().capped(10000));
      

      Stack trace

      java.lang.NullPointerException
      	at org.springframework.data.mongodb.core.MongoTemplate.convertToDocument(MongoTemplate.java:1964)
      	at org.springframework.data.mongodb.core.MongoTemplate.createCollection(MongoTemplate.java:477)
      	at org.springframework.data.mongodb.core.MongoTemplate.createCollection(MongoTemplate.java:468)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mp911de Mark Paluch
                Reporter:
                mp911de Mark Paluch
                Last updater:
                Mark Paluch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: