Skip to content

MongoDB-Unity is a lightweight integration of the MongoDB .NET Driver for Unity game development. This package enables developers to easily connect and interact with MongoDB databases from within Unity, allowing for efficient data storage and retrieval for games and applications.

Notifications You must be signed in to change notification settings

trongtindev/MongoDB-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB-Unity

MongoDB-Unity is a Unity package that simplifies the use of the MongoDB.Driver within Unity projects. It allows developers to seamlessly integrate MongoDB for data storage, enabling robust game features and persistence.

Features

  • Connect to MongoDB databases directly from Unity.
  • Perform CRUD operations easily.
  • Supports asynchronous operations for improved performance.
  • Lightweight and easy to set up.

How are DLLs extracted?

dotnet new classlib --framework "netstandard2.0" -o MongoDBUnity
cd MongoDBUnity
dotnet add package MongoDB.Driver
dotnet publish

Installation

Unity Package

  1. Download the latest release of the package from the latest release and import it to your project.
  2. Import the .unitypackage file into your Unity project.

UPM Package

MongoDB-Unity can also be installed via UPM package.

https://github.com/trongtindev/MongoDB-Unity.git?path=/Assets/MongoDB-Unity

Getting Started

using MongoDB.Bson;
using MongoDB.Driver;
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("foo");
var collection = database.GetCollection<BsonDocument>("bar");

await collection.InsertOneAsync(new BsonDocument("Name", "Jack"));

var list = await collection.Find(new BsonDocument("Name", "Jack"))
    .ToListAsync();

foreach(var document in list)
{
    Console.WriteLine(document["Name"]);
}

Documentation

Supported Platform

Currently, MongoDB-Unity supports Windows, macOS and Linux.

Contributing

Contributions are welcome! Please open issues or submit pull requests for any improvements or bug fixes.

About

MongoDB-Unity is a lightweight integration of the MongoDB .NET Driver for Unity game development. This package enables developers to easily connect and interact with MongoDB databases from within Unity, allowing for efficient data storage and retrieval for games and applications.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages