Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python local nosql database

# pip install tinydb

from tinydb import TinyDB, Query, where

db = TinyDB('db.json')
# insert some data
db.insert({'name': 'Leonid', 'age': 23})
db.insert({'name': 'Miro', 'age': 32})
db.insert({'name': 'Mihaela', 'age': 19})

# Two ways to query
# 1
print(db.search(where('age')> 20))

#2
Person = Query()
print(db.search(Person.name == 'Leonid'))
Source by pypi.org #
 
PREVIOUS NEXT
Tagged: #python #local #nosql #database
ADD COMMENT
Topic
Name
2+8 =