Git Product home page Git Product logo

koa2-weibo's Introduction

koa2 项目

kuangJia分支是对koa2框架的创建, 目录整理

sequelize分支是对 sequelize Api的整理

创建数据

User.create({
nickName: 'YangY',
userName: 'dongyang.liu',
passWord: '123456'
})

查询数据

findOne 查询一条数据
findAll 查询所有数据
findAll({
limit: 2, 查询2条数据
offset: 0 跳过多少条
})
findAndCountAll
User.findOne({
where: { //查询条件
nickName: 'YangY',
userName: 'dongyang.liu'
},
order: [ //排序方式
['id', 'desc'] //根据id倒序
]
})

更改数据

Article.update({
title: '新的title'
}{
where: {
title: 'xxx' //查询要改的那个条数据
}
})

删除数据

Article.destroy({
where: {
title: 'xxx'
}
})

koa2-weibo's People

Contributors

yangy-19 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.