Skip to content

A lightweight, persistent, NoSQL database written in Go.

License

Notifications You must be signed in to change notification settings

billykirk01/AlgoeDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlgoeDB

A light, Embeddable, NoSQL database written in Go.

Inspired by (and wherever possible a port of) the Deno project AloeDB. Many thanks to @Kirlovon for the inspiration!

Features

  • 🎉 Simple to use API, similar to MongoDB!
  • 🚀 Optimized for a large number of operations.
  • ⚖ No dependencies outside of the standard library.
  • 📁 Stores data in readable JSON file.

Examples Usage

config := AlgoeDB.DatabaseConfig{Path: "/path/to/file/people.json"}
db, err := AlgoeDB.NewDatabase(&config)
if err != nil {
    log.Fatal(err)
}

people := []map[string]interface{}{}
people = append(people, map[string]interface{}{"name": "Billy", "age": 27})
people = append(people, map[string]interface{}{"name": "Carisa", "age": 26})

err = db.InsertMany(people)
if err != nil {
    log.Fatal(err)
}

query := map[string]interface{}{"name": "Carisa"}
results := db.FindOne(query)

if results != nil {
    fmt.Println("results:", results) //results: [map[age:26 name:Carisa]]
} else {
    fmt.Println("no documents found")
}

query = map[string]interface{}{"age": AlgoeDB.MoreThan(25)}
results = db.FindMany(query)

if results != nil {
    fmt.Println("results:", results) //results: [map[age:27 name:Billy] map[age:26 name:Carisa]]
} else {
    fmt.Println("no documents found")
}

About

A lightweight, persistent, NoSQL database written in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages