当前位置:网站首页>Mongodb index
Mongodb index
2022-07-03 14:22:00 【Rice field prospector】
Create index db.comment.createIndex({userid:1})
comment Is the name of the database , userid Is the field of the database
Look at the index db.comment.getIndexes()
Create composite index db.comment.createIndex({userid:1,nickname:-1})
Field names include userid and nickname
Remove index db.comment.dropIndex({userid:1})
Remove complex indexes db.comment.dropIndex("userid_1_nickname_-1")
Remove all of all db.comment.dropIndexes()
边栏推荐
- 【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
- Configure stylelint
- 剑指 Offer 28. 对称的二叉树
- Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
- Exercise 9-1 time conversion
- 7-4 BCD decryption (10 points)
- Invalid Z-index problem
- The mail function of LNMP environment cannot send mail
- Solution to failure or slow downloading of electron when electron uses electron builder to package
- Selective sorting
猜你喜欢
Understanding of closures
npm install卡住与node-npy的各种奇怪报错
必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
Article content typesetting and code highlighting
Why is this error reported when modifying records in the database
如何查询淘宝天猫的宝贝类目
Interface for querying IP home
Programming language: the essence of type system
TS code automatically generates JS
Exercise 8-7 string sorting
随机推荐
Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
C library function - qsort()
Doris学习笔记之数据表的创建
Understand the application scenario and implementation mechanism of differential segment
GRPC的四种数据流以及案例
别再问自己适不适合做软件测试了
Ultra simple mobile map development
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
JS get DPI, PX to cm, cm to PX
Common mixins
Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
Solution to failure or slow downloading of electron when electron uses electron builder to package
Reflection -- basic usage
7-6 mixed type data format input
Invalid Z-index problem
Too many files with unapproved license
7-23 currency conversion (using array conversion)
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
Recent learning summary
7-14 sum integer segments (C language)