mongodb操作

1. mac下的安装

2. mongodb和pymongo的使用

2.1 MongoDB 教程

2.2 PyMongo 3.7.2 Documentation

3. Mongodb For Android

  1. Android 连接MongoDB与基本操作

  2. java 操作mongodb查询条件设置

    1.$where

    1
    2
    condition = new BasicDBObject();
    condition.put("$where", ageStr);

    2.$in

    1
    2
    condition = new BasicDBObject()
    condition.put("age", new BasicDBObject("$in", values))

    3.模糊匹配

    • 完全匹配
    • 左匹配
    • 右匹配
    • 模糊匹配

    4.$gte/$lte/$gt/lt

    1
    condition.append("age", new BasicDBObject("$gt",20))

4. Mongodb异常

Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:257:13

Same error here, this worked for me:

1
sudo mongod --repair
1
sudo mongod

Then on a different tab/terminal:

1
mongo

mongodb - 链接

Failed to start mongod.service: Unit not found

MongoDB安装+解决错误:Failed to start mongod.service:until not found

Ubuntu 16.04安装mongoDB 4.0.1

ubuntu18.04安装mongoDB 4.0

在Ubuntu 16.04上安装、使用、卸载MongoDB

mongodb基本操作(客户端命令行)

远程连接mongodb时,27017端口连接不上的解决办法

linux服务器mongodb服务环境搭建与连接