zoukankan      html  css  js  c++  java
  • MySQL与MongoDB

    MySQL        MongoDB

    DB    DB

    table   Collections

    row    Documents

    column    Field

    db.tables.insert({})#效率低不用了  #官方不推荐

    db.tables.insertone({})

    db.tables.insertmoney([{},{}]) 

    db.tables.remove({条件}) #官方不推荐

    db.tables.deleteOne({条件})

    db.tables.deleteMany({条件})

    db.tables.drop({})

    db.tables.update({条件},{$修改器:{数据}}) #官方不推荐

    db.tables.updateOne({条件},{$修改器:{数据}})

    db.tables.updateMany({条件},{$修改器:{数据}})

    show dbs #查看卸载磁盘上的数据库

    show tables # 

    db.tables.find({条件})

    {,} and 条件

    {'$or':[{},{}]} 

    {"name":{"$in":["",""]}} $in

    {hobby:{$all:[]}  $all

    $关键字

    $gt
    $gte
    $lt
    $lte
    $eq:

    $修改器:

    $set 

    $unset 

    $inc  #引用增加

    $push

    $pull

    $pop #不含索引 -1 从前往后删 1 从后往前删

  • 相关阅读:
    Pytest学习之 autouse=True,自动调用fixture功能
    Pytest学习之xfail使用
    Pytest学习之use fixtures
    python
    python
    python
    python
    python
    python
    python
  • 原文地址:https://www.cnblogs.com/Lucifer77/p/10658814.html
Copyright © 2011-2022 走看看