db.getById returns list
See original GitHub issueDescribe the bug Title says it all
How to reproduce Call someDb.getById(123)
Expected behavior
I expect a maximum of 1 item to be returned when calling getById, or a DuplicateIdError
to be raised if multiple rows with the same id exist
Workaround This is probably unsafe…
row = someDb.getById(123)[0]
Edit: It appears that this is more of an issue with type-hinting rather than an actual problem with the type actually returned by the function
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
JPA Repository.findById() returns null but the value is exist on db
What I wanna know is repository.findById(id) method returns null, whereas data is available in the DB. Functions save() and findAll() are ...
Read more >JpaRepository (Spring Data JPA Parent 3.0.0 API)
Flushes all pending changes to the database. T. getById(ID id). Deprecated. ... Returns a reference to the entity with the given identifier. <S...
Read more >findById returns no results even with correct ObjectId #3079
Configuration: Mongoose 4.0.5, MongoDb 3.0.4, Node 0.12.4 Issue does not appear on Mongoose 3.8.30 My database has the following data: ...
Read more >Derived Query Methods in Spring Data JPA Repositories
Oh, and it actually generates JPA entities from an existing database and gradually update the data ... List<User> findByName(String name)
Read more >Controller action return types in ASP.NET Core web API
[HttpGet] public Task<List<Product>> Get() => _productContext.Products. ... return new CreatedAtActionResult(nameof(GetById), "Products", ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I just tried to stand up a development environment and hit a roadblock with pytest. Totally solvable, but easier if I don’t have to.
Thanks for taking care of it. 😃
@NicoHood try V2.