question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.find() function does not work after a single use

See original GitHub issue

Describe the bug When writing data to the JSON db, after the first write to the file, the .find() method will return the record based on the ID. After adding a 2nd record and trying again, the IdNotFoundError error is thrown despite the record being in the DB!

How to reproduce python 3.9.6

from pysondb import db

if __name__ == "__main__":
    db = db.getDb("test.json")
    while True:
        id = db.add({"dev": "test"})
        print(db.find(id))

Expected behavior The record should be returning as expected.


This is a neat library, great work!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LyndonFancommented, Sep 30, 2021

That would be great, thanks!

1reaction
LyndonFancommented, Sep 30, 2021

Hi, is the issue still open? I can try to work on it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python find function not working. What am I doing wrong?
First of, your code to read in the sequence and the motif could be improved by using splitlines() , which takes care of...
Read more >
How to correct a #N/A error in the VLOOKUP function
Problem: The lookup value is not in the first column in the table_array argument · Consider using INDEX/MATCH instead · Problem: The exact...
Read more >
Array.prototype.find() - JavaScript - MDN Web Docs - Mozilla
The find() method returns the first element in the provided array that satisfies the provided testing function.
Read more >
6 Reasons Why Your VLOOKUP is Not Working - Ablebits
This article will look at the 6 most common reasons why your VLOOKUP is not working.
Read more >
Top 10 Most Common C++ Mistakes That Developers Make
However, this was just the simplest example of this C++ problem. ... Never use auto_ptr as a function argument since this will lead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found