#78 Limiting fields | Using MongoDB with Express| A Complete NODE JS Course

  Рет қаралды 4,129

procademy

procademy

Күн бұрын

In this lecture you will learn how to limit only certain fields in the result so that you can avoid sending sensitive data over the wire. And this is also a good practice to allow users to select which fields user wants in the result and avoid overwhelming the network bandwidth.

Пікірлер: 15
@omaryasser2727
@omaryasser2727 27 күн бұрын
10:40 In Mongoose 8.x.x You can mix between inclusion and exclusion fields
@Tech_bro-i5g
@Tech_bro-i5g 2 ай бұрын
Please sir! if you can help. People are encountering a common issue with the sort and limit logics, i inclusive. The both of them are returning null, empty array, when we run it in postman.
@avantikaverma9350
@avantikaverma9350 8 ай бұрын
I am using the mongoose 8.0.3 version , will req.query.sort or req.query.fields ..will work ..as I am not getting the desired results
@Tech_bro-i5g
@Tech_bro-i5g 2 ай бұрын
I am using the same version, have you resolved your issue?
@acupoflie
@acupoflie 2 ай бұрын
@@Tech_bro-i5g i explained the solve in comments of this and previous video add this line of codes: delete queryObj.sort delete queryObj.fields before the "let query = Movie.find(queryObj) " Because mongoose trying to fetch the documents that match with the parameters entered the query string, in that case it can't find anything and returns null
@AnilKumar-pb3pc
@AnilKumar-pb3pc Ай бұрын
Have you resolved this :)
@kartiksethi290
@kartiksethi290 22 күн бұрын
​@@acupoflie thanks bro
@DecoyCheats
@DecoyCheats Жыл бұрын
I had '__v' removed before I even wrote the excluding code.
@Tech_bro-i5g
@Tech_bro-i5g 2 ай бұрын
Have you resolved your issue?
@rishiraj2548
@rishiraj2548 Жыл бұрын
🙏💯
@YosephRegassa
@YosephRegassa Жыл бұрын
Why is it returning null
@Tech_bro-i5g
@Tech_bro-i5g 2 ай бұрын
Mine is also returning null. Have you resolved your issue?
@SatwikBhatia-yf7uk
@SatwikBhatia-yf7uk 28 күн бұрын
@@Tech_bro-i5g i guess dont pass any parameter to .fin() method
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 54 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 70 МЛН
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 4,9 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
Angular - All about pipes (Custom pipe, Pure and Impure)
4:42
Project Brackets
Рет қаралды 10 М.
Advanced Schema Design Patterns
43:15
MongoDB
Рет қаралды 45 М.
Build REST API with Node Express MongoDB - Sorting and Limiting Fields #25
11:02
MASTERING Bar Charts in Power BI | No more Cut Labels
15:34
How to Power BI
Рет қаралды 121 М.
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 54 МЛН