Use model.find() to Search Your Database 2

Cuéntanos qué está pasando:
No me permite pasar esta prueba

Enlace(s) de tu proyecto

solution: boilerplate-mongomongoose - Replit

Información de tu navegador:

El agente de usuario es: Versión 102.0.5005.115 (Build oficial) (64 bits)

Desafío: Usa model.find() para buscar en tu base de datos

Enlaza al desafío:

Your code is passing for me with my own DB.

Are you getting any errors, did you check the network tab in the browser in submitting?

Also, you should be installing the exact versions of the libs as asked for in the first challenge.

1 Like

I get this error in the network tab:
“E11000 duplicate key error collection: test.people index: name_1 dup key: { name: “r@nd0mN4m3” }”

The virtual server automatically updates the packages, however, I don’t remember what the versions were when I started the first challenge.

But I don’t remember the version of these packages
How can I know that?

Did you change the Schema at some point?

I think I have seen that error from having used unique: true with the schema value. If you did you may have to delete the collection and try again.

try to change mongoose version ^6.3.6, from replit packages i couldn’t.
From the virtual server terminal I could, but it is not reflected in the replit packets, nor is it recorded in the packet.json nor with the --save option.
I still don’t know how to change it here in replit

Don’t use that option, see:
const personSchema = new Schema({
name: {
required: true
favoriteFoods: [String]

Otherwise I would have tried

That is why I asked if you had changed the Schema. I know you are not using it now.

It’s just I know I have seen that error with the use of unique. Try deleting the collection and see what happens.

You can also search for “E11000 duplicate key error collection” to see why I’m suggesting this.

You should also install the correct versions of the libs as pointed out.