Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

869
Views
ObjectParameterError: el parámetro "filtro" para encontrar () debe ser un objeto, se obtuvo la búsqueda

esta ruta de obtención no da ningún error en post-man pero hace lo mismo con la interfaz que da error en la consola del nodo:

 ObjectParameterError: Parameter "filter" to find() must be an object, got search

aunque se obtienen respuestas .

obtener controlador

 const Recent = require("../models/recent"); const getRecentByName = async (req, res, next) => { const name = req.params.name; let regex = new RegExp(name, "i"); let players; try { players = await Recent.find({ name: { $regex: regex } }); } catch (err) { return next(err); } if (!players) { return next("no player found"); } // console.log(players); res.json({ players }); }; exports.getRecentByName = getRecentByName;

Obteniendo de la interfaz:

 const searchRecords = async () => { const data = await sendRequest( "http://localhost:5000/api/player/recent/search/" + search, "GET" ); setRecord(data.players); };

Recientes: (esquema de mangosta):

 const mongoose = require("mongoose"); const Schema = mongoose.Schema; const recentSchema = new Schema({ name: { type: String, required: true }, recent: [ { team1: { type: String }, team2: { type: String }, points: { type: Number, required: true }, date: { type: Date }, }, ], }); module.exports = mongoose.model("Recent", recentSchema);
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Creo que el problema es frontal y en la URL deberías usar http://localhost:5000/api/player/recent/search/${search}

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!