-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
7db0efe
commit 2d0a4b0
Showing
9 changed files
with
114 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,87 @@ | ||
# MongodbConn | ||
# mongoconn | ||
|
||
![GitHub contributors](https://img.shields.io/github/contributors/sivaosorg/gocell) | ||
![GitHub followers](https://img.shields.io/github/followers/sivaosorg) | ||
![GitHub User's stars](https://img.shields.io/github/stars/pnguyen215) | ||
|
||
A Golang MongoDB connector library with a comprehensive set of features for interacting with MongoDB databases, including CRUD operations, aggregation, and file handling. | ||
|
||
## Table of Contents | ||
|
||
- [mongoconn](#mongoconn) | ||
- [Table of Contents](#table-of-contents) | ||
- [Introduction](#introduction) | ||
- [Prerequisites](#prerequisites) | ||
- [Key Features](#key-features) | ||
- [Installation](#installation) | ||
- [Modules](#modules) | ||
- [Running Tests](#running-tests) | ||
- [Tidying up Modules](#tidying-up-modules) | ||
- [Upgrading Dependencies](#upgrading-dependencies) | ||
- [Cleaning Dependency Cache](#cleaning-dependency-cache) | ||
|
||
## Introduction | ||
|
||
Welcome to the MongoDB Connector for Go repository! This library provides a powerful set of tools for seamless interaction with MongoDB databases in your Go applications. It supports a wide range of functionalities, including document creation, retrieval, updating, deletion, aggregation, and file handling. | ||
|
||
## Prerequisites | ||
|
||
Golang version v1.20 | ||
|
||
## Key Features | ||
|
||
- CRUD Operations: Create, read, update, and delete documents in MongoDB with ease. | ||
- Aggregation Framework: Leverage MongoDB's aggregation framework to perform complex data manipulations. | ||
- Transaction Support: Conduct transactions securely with MongoDB's transaction functionality. | ||
- File Handling: Upload and download files to and from MongoDB GridFS. | ||
- Database Backup and Restore: Backup and restore your MongoDB databases effortlessly. | ||
|
||
## Installation | ||
|
||
- Latest version | ||
|
||
```bash | ||
go get -u github.com/sivaosorg/mongoconn@latest | ||
``` | ||
|
||
- Use a specific version (tag) | ||
|
||
```bash | ||
go get github.com/sivaosorg/mongoconn@v0.0.1 | ||
``` | ||
|
||
## Modules | ||
|
||
Explain how users can interact with the various modules. | ||
|
||
### Running Tests | ||
|
||
To run tests for all modules, use the following command: | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
### Tidying up Modules | ||
|
||
To tidy up the project's Go modules, use the following command: | ||
|
||
```bash | ||
make tidy | ||
``` | ||
|
||
### Upgrading Dependencies | ||
|
||
To upgrade project dependencies, use the following command: | ||
|
||
```bash | ||
make deps-upgrade | ||
``` | ||
|
||
### Cleaning Dependency Cache | ||
|
||
To clean the Go module cache, use the following command: | ||
|
||
```bash | ||
make deps-clean-cache | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/sivaosorg/govm/dbx" | ||
"github.com/sivaosorg/govm/logger" | ||
"github.com/sivaosorg/govm/mongodb" | ||
"github.com/sivaosorg/mongoconn" | ||
) | ||
|
||
func createConn() (*mongoconn.MongoDB, dbx.Dbx) { | ||
return mongoconn.NewClient(*mongodb.GetMongodbConfigSample()) | ||
} | ||
|
||
func TestConn(t *testing.T) { | ||
_, s := createConn() | ||
logger.Infof("Mongo connection status: %v", s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/sivaosorg/mongodbconn | ||
module github.com/sivaosorg/mongoconn | ||
|
||
go 1.20 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mongodbconn | ||
package mongoconn | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package mongoconn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mongodbconn | ||
package mongoconn | ||
|
||
import ( | ||
"github.com/sivaosorg/govm/dbx" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mongodbconn | ||
package mongoconn | ||
|
||
import ( | ||
"bytes" | ||
|
This file was deleted.
Oops, something went wrong.