Springdata MongoDB version compatibility causes Error [the ' cursor ' option is required, except for aggregate with the explain argument

Source: Internet
Author: User
Tags mongodb version



Use aggregation to throw exceptions in spring data MongoDB MongoDB version 3.6


Org.springframework.dao.InvalidDataAccessApiUsageException:Command execution failed: for

 


Spring Data MongoDB version




<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
            <version>1.5.8.RELEASE</version>
</dependency>


Upgrading Mongodb-driver to 3.6 does not solve the problem




<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mongodb</groupId>
                    <artifactId>mongodb-driver</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver</artifactId>
            <version>3.6.0-beta2</version>
        </dependency>


Downgrade the MongoDB version to 3.4



It's a yum source.



MongoDB 3.4




3.4 
1. vi /etc/yum.repos.d/mongodb-3.4.repo  
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ gpgcheck=0 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc


MongoDB 3.6





2. vim /etc/yum.repos.d/mongodb-org-3.4.repo  
3. [mongodb-org-3.4]  
4. name=MongoDB Repository  
5. baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/  
6. gpgcheck=0  
7. enabled=1  
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc 


Although the warehouse is written in 3.4, it will actually download the new version of 3.6


 
Dependency resolution

=========================================================== =========================================================== =========================================================== =========================================================== =========================================================== =====================
 Package architecture version source size
=========================================================== =========================================================== =========================================================== =========================================================== =========================================================== =====================
deleting:
 Mongodb-org x86_64 3.6.0-0.1.rc0.el7 @mongodb-org-3.4 0.0
 Mongodb-org-mongos x86_64 3.6.0-0.1.rc0.el7 @mongodb-org-3.4 31 M
 Mongodb-org-server x86_64 3.6.0-0.1.rc0.el7 @mongodb-org-3.4 56 M
 Mongodb-org-shell x86_64 3.6.0-0.1.rc0.el7 @mongodb-org-3.4 31 M
 Mongodb-org-tools x86_64 3.6.0-0.1.rc0.el7 @mongodb-org-3.4 152 M

Transaction summary
=========================================================== =========================================================== =========================================================== =========================================================== =========================================================== ===================





Springdata MongoDB version compatibility causes Error [the ' cursor ' option is required, except for aggregate with the explain argument


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.