[实习记录]mongodb相关

  • 安装:
    https://stackoverflow.com/questions/27784956/error-couldnt-add-user-not-authorized-on-test-to-execute-command-createuser
  • 进入:
    mongo --port 27017 -u root -p 123456 --authenticationDatabase admin
  • 查询语句:
    https://blog.csdn.net/qq_27093465/article/details/51700435
  • 查询数组中的单值:
    https://blog.csdn.net/DrifterJ/article/details/7833883
  • 查询数组中的单值(spring data mongo):
        System.out.println("--------------------------------");
        System.out.println(repository.findByDoctor("tx-default"));

        System.out.println("labels found with findByReviewersContains('algo-depart'):");
        System.out.println("--------------------------------");
        List label_list = new ArrayList<>();
        label_list = repository.findByReviewersContains("algo-depart");
        for (Label_Information label : label_list) {
            System.out.println(label.getDoctor());
            System.out.println(label.getReviewers());
            System.out.println(label.getEtiologys());
            System.out.println(label.getReview_time());
        }
  • repository命名方法规则
    https://blog.csdn.net/sbin456/article/details/53304148

  • idea插件:mongo plugin

你可能感兴趣的:([实习记录]mongodb相关)