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

Add SLAVE_OK as a cursor option throws an exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.10 (Lovelace SR10)
    • Fix Version/s: 2.2 RC3 (Moore)
    • Component/s: Repository
    • Labels:
      None

      Description

      Add the annotation

      @Meta(flags = CursorOption.SLAVE_OK)

      to a repository method makes the query fail with

      java.lang.IllegalArgumentException: SLAVE_OK is no supported flag 

       

      The expected behavior following the documentation would be to allow the query to perform in the secondary replicas. https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo.query.additional-query-options

       

      Here there's a project reproducing the issue:

      https://github.com/rena-souza/spring-mongo-slave-ok-error

       

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            rena.souza Renã Souza
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: