JSONexus
  • Getting Started
  • Installation Guide
  • Usage Scenarios
  • Comparison Operators
  • Operations
  • Data Modeling in JSONexus
  • Storage Options in JSONexus
  • About JSONexus
Powered by GitBook
On this page
  • Functions in JSONexus
  • 1. Insert
  • 2. Find
  • 3. Update
  • 4. Delete
  • 5. Count
  • 6. Get Collection
  • 7. Get Document
  • 8. Drop Collection
  • 9. Insert Many
  • 10. Additional Resources

Operations

Functions in JSONexus

JSONexus provides various functions to manipulate and query data in the database.

1. Insert

Insert a new document into a collection.


 db.insert('users', {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'})
    

2. Find

Find documents that match a specified query.


result = db.find('users', {'age': {'_op': '$eq', '_value': 35}})
    

3. Update

Update documents that match a specified query.


db.update('users', {"age": {'_op': '$eq', '_value': 23}}, {"job": "Junior DEV"}

4. Delete

Delete documents that match a specified query.


  db.delete('users', {'name': {'_op': '$eq', '_value': "Alice"}})
  

5. Count

Count the number of documents in a collection.


 count = db.count('users')
    

6. Get Collection

Get all documents in a collection.


collection = db.get_collection('users')
    

7. Get Document

Get a single document from a collection.


  document = db.get_document('users', '6b72a5d2-6f95-4e49-a152-e24e4415fc0e')
    

8. Drop Collection

Drop a collection from the database.


 db.drop_collection('users')
    

9. Insert Many

Insert multiple documents into a collection.

db.insert_many('users', [
    {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'},
    {'name': 'Bob', 'age': 25, 'email': 'bob@example.com'},
    {'name': 'Charlie', 'age': 35, 'email': 'charlie@example.com'}
])

10. Additional Resources

PreviousComparison OperatorsNextData Modeling in JSONexus

Last updated 1 year ago

Refer to the for detailed usage instructions, API reference, and examples.

documentation