MongoDB Tutorial #11 - Object ID

preview_player
Показать описание
Hey gang, in this Mongodb tutorial I'll show you how we can reference records by their object ID .

----- COURSE LINKS:

---------------------------------------------------------------------------------------------

========== PSD to WordPress Playlist ==========

============== The Net Ninja =====================

================== Social Links ==================

Рекомендации по теме
Комментарии
Автор

Very nice! But I still do not understand how could I perform a query using _id of a document added to the database in the previous days or months. What is the purpose of _id, if we cannot use it for future queries? Would it be good to create a convention, and generate, in application, a custom identifier, that we would use later on to make a document-specific query?

pbznt
Автор

I think you helped me a lot with a problem I had for some days. But what's the name for the package you use for the " describe; it; beforeEach" functions?

uplife
Автор

Fantastic series. Thank you so much for this!

kevinpalmer
Автор

you can use:
assert(rs._id.str === char._id.str);

freeidol
Автор

Another epic series, nice one Net Ninja!

niceonedigital
Автор

For those who get the Error: Uncaught TypeError: Cannot read property '_id' of null
the done() has to be called in a function:
char.save().then(function(){
done();
});

jurajbeger
Автор

Hey Shaun, is there any reason you are using var to declare your character and not const or let?

pankfish
Автор

This is an old video however instead of result._id.toString() === char._id.toString(), you can do result._id.equals(char._id)

gayathrikc
Автор

I am getting this after the test:
(node:9860) Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]: false == true
(node:9860) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

wirgei
Автор

still dont understand how the connection.js file is linked with all these other files.

martinmtandi
Автор

Hi Shaun just wanted to ask why did the comparison of Objects fail? Is it because the arguments are different Objects that points to the same Object? Thanks for this great tut.

mataal
Автор

Does the find return what it founds in an array? Unlike findOne? which return an object?

miguelitossss
Автор

Can we query records based on timestamp of record creation(between 2 dates) using mango template criteria in spring boot application.?

diwakar.singh_official
Автор

hey ninja can u help me with this i got an error like this TypeError: Cannot read property '_id' of undefined

andriesrunkat
Автор

My test passed gracefully when I used equals() instead of using toString(). Is it okay to use equals() ?

codecrayon
Автор

I don't know if I understood the logic but let's take a case where there are 2 items with the same name and different object_id is your method still valid

kamelmili
Автор

first time ive had any problem with your tutorials, for some reason it is telling me _id is undefined and im not very sure why. all other tests are passing

nicholasrotondo
Автор

And the series is rather restricted to mongoose, should have clarified in the title

papasilverhand
Автор

I am learning javascript almost 9 months and this mongodb tutorials confused me a lot, I have not mastered front-end, so the backend is still hard for me .

pouvoircerveau
Автор

I Have Problem I Can't Make Query So It Says

λ npm run test

> mocha



Connection Has Been Made Successfully
Finding Records
1) "before each" hook

Adding Number To Another
√ Saving The Data Into


1 passing (214ms)
1 failing

1) Finding Records "before each" hook:
Uncaught ReferenceError: done is not defined

Any Clue ?

zymawy