Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the MongoDB interview questions?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

MongoDB interview questions, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can gain something.

Concept Introduction

Redis stands for Remote Server and is currently the hottest non-relational database. Single thread, default port 6379.

The main advantages are:

1. Super fast.

2. There is no connection between the tables.

3. No table structure.

4. Any data.

Visual Tools and Introduction (Studio 3T)

Database: A single MongoDB can create multiple databases.

Collection: MongoDB's document group.

Documentation: The place where data is actually stored.

Add, delete, modify and search documents

1. query

db.getCollection('hello-collection').find({});

2. new

db.getCollection ('hello-collection').insert({_id:1,name:'Zhang San'});

ObjectId is a primary key specified by default

3. modify

db.getCollection ('hello-collection').update({id:1,name:'Zhang San'},{$set:{name:' Li Si'},{multi:true});

The last multi attribute represents whether to modify one or more pieces of data.

index (index)

1. Query index:

_id index Single key index Multiple key index Composite index Outdated index

2. full-text index

index_type to establish full-text index, there are stop words is, a, such English query workload is huge, but does not support Chinese,"Zhang San" in "Zhang San,""Li Si" can not, so his full-text index function is not strong.

3. geo-location index

index_type is 2d, 3d

Copy Set (Master-Slave Copy)

Replicate source oplog (not only master but slave)

op:i(insert) u(update)

ns: namespace

o: New data

Affairs management

Based on the session, it only takes effect on the replication set.

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report