skip to Main Content

Mongodb – get does not return the data in express

I'm working with a simple GET request but it returns nothing in the browser with no warnings. I checked all the connections to Mongoose works perfectly and collection name are correct. const uriAtlas = "mongodb://localhost:27017/appfullMern"; mongoose.connect(uriAtlas).then(() => console.log("successful connexion DB")…

VIEW QUESTION

Mongodb – Cast to ObjectId failed for value "6283201d60c794631cd1ba33n" (type string) at path "_id" for model "Post"

I'm working on a social media project and getting this getting when I'm sending like/Unlike post request CastError: Cast to ObjectId failed for value "6283n" (type string) at path "_id" for model "Post" at model.Query.exec (E:social-media-app-mernnode_modulesmongooselibquery.js:4639:21) at model.Query.Query.then (E:social-media-app-mernnode_modulesmongooselibquery.js:4738:15) at…

VIEW QUESTION

URLs ignore arguments in GET request (ASP.NET)

I need to write a Web API for this request: {apiUrl}/api/sessions/byhour?startTime=2021-06-30T01:00:00&endTime=2021-06-30T03:00:00 So I have this controller and method: [ApiController] [Route("/api/sessions/byhour")] public class LoginStatsByHourController : ControllerBase { [HttpGet, Route("{startTime=0001-01-01T12:00:00}/{endTime=9999-12-31T11:59:59}")] public List<SessionEntry> GetSessionEntryByDate(string startTime, string endTime) {...} } I tested this request:…

VIEW QUESTION
Back To Top
Search