-
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.
Added FindOneAndDeleteById, FindOneAndReplaceById, FindOneAndUpdateBy…
…Id and global option
- Loading branch information
Gabriel Cataldo
committed
Feb 18, 2024
1 parent
727e3e6
commit 420b420
Showing
19 changed files
with
845 additions
and
388 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
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
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,82 +1,15 @@ | ||
package mongo | ||
|
||
import "github.com/GabrielHCataldo/go-errors/errors" | ||
|
||
var MsgErrRefDocument = "mongo: ref document needs to be structure or slice of the struct" | ||
var MsgErrDatabaseNotConfigured = "mongo: database not correct configured" | ||
var MsgErrCollectionNotConfigured = "mongo: collection not correct configured" | ||
var MsgErrDocumentIsNotPointer = "mongo: document param is not a pointer" | ||
var MsgErrDocumentIsNotStruct = "mongo: document param is not a struct" | ||
var MsgErrDocumentIsEmpty = "mongo: document param is empty" | ||
var MsgErrDocumentsIsEmpty = "mongo: documents param is empty" | ||
var MsgErrDestIsNotPointer = "mongo: dest param is not a pointer" | ||
var MsgErrDestIsNotStruct = "mongo: dest param is not a struct" | ||
var MsgErrNoDocuments = "mongo: no documents in result" | ||
var MsgErrNoOpenSession = "mongo: no open session" | ||
|
||
var ErrRefDocument = errors.New(MsgErrRefDocument) | ||
var ErrDatabaseNotConfigured = errors.New(MsgErrDatabaseNotConfigured) | ||
var ErrCollectionNotConfigured = errors.New(MsgErrCollectionNotConfigured) | ||
var ErrDocumentIsNotPointer = errors.New(MsgErrDocumentIsNotPointer) | ||
var ErrDocumentIsNotStruct = errors.New(MsgErrDocumentIsNotStruct) | ||
var ErrDocumentIsEmpty = errors.New(MsgErrDocumentIsEmpty) | ||
var ErrDocumentsIsEmpty = errors.New(MsgErrDocumentsIsEmpty) | ||
var ErrDestIsNotPointer = errors.New(MsgErrDestIsNotPointer) | ||
var ErrDestIsNotStruct = errors.New(MsgErrDestIsNotStruct) | ||
var ErrNoDocuments = errors.New(MsgErrNoDocuments) | ||
var ErrNoOpenSession = errors.New(MsgErrNoOpenSession) | ||
|
||
func errRefDocument(skip int) error { | ||
ErrRefDocument = errors.NewSkipCaller(skip+1, MsgErrRefDocument) | ||
return ErrRefDocument | ||
} | ||
|
||
func errDatabaseNotConfigured(skip int) error { | ||
ErrDatabaseNotConfigured = errors.NewSkipCaller(skip+1, MsgErrDatabaseNotConfigured) | ||
return ErrDatabaseNotConfigured | ||
} | ||
|
||
func errCollectionNotConfigured(skip int) error { | ||
ErrCollectionNotConfigured = errors.NewSkipCaller(skip+1, MsgErrCollectionNotConfigured) | ||
return ErrCollectionNotConfigured | ||
} | ||
|
||
func errDocumentIsNotPointer(skip int) error { | ||
ErrDocumentIsNotPointer = errors.NewSkipCaller(skip+1, MsgErrDocumentIsNotPointer) | ||
return ErrDocumentIsNotPointer | ||
} | ||
|
||
func errDocumentIsNotStruct(skip int) error { | ||
ErrDocumentIsNotStruct = errors.NewSkipCaller(skip+1, MsgErrDocumentIsNotStruct) | ||
return ErrDocumentIsNotStruct | ||
} | ||
|
||
func errDocumentIsEmpty(skip int) error { | ||
ErrDocumentIsEmpty = errors.NewSkipCaller(skip+1, MsgErrDocumentIsEmpty) | ||
return ErrDocumentIsEmpty | ||
} | ||
|
||
func errDocumentsIsEmpty(skip int) error { | ||
ErrDocumentsIsEmpty = errors.NewSkipCaller(skip+1, MsgErrDocumentsIsEmpty) | ||
return ErrDocumentsIsEmpty | ||
} | ||
|
||
func errDestIsNotPointer(skip int) error { | ||
ErrDestIsNotPointer = errors.NewSkipCaller(skip+1, MsgErrDestIsNotPointer) | ||
return ErrDestIsNotPointer | ||
} | ||
|
||
func errDestIsNotStruct(skip int) error { | ||
ErrDestIsNotStruct = errors.NewSkipCaller(skip+1, MsgErrDestIsNotStruct) | ||
return ErrDestIsNotStruct | ||
} | ||
|
||
func errNoDocuments(skip int) error { | ||
ErrNoDocuments = errors.NewSkipCaller(skip+1, MsgErrNoDocuments) | ||
return ErrNoDocuments | ||
} | ||
|
||
func errNoOpenSession(skip int) error { | ||
ErrNoOpenSession = errors.NewSkipCaller(skip+1, MsgErrNoOpenSession) | ||
return ErrNoOpenSession | ||
} | ||
import "errors" | ||
|
||
var ErrRefDocument = errors.New("mongo: ref document needs to be structure or slice of the struct") | ||
var ErrDatabaseNotConfigured = errors.New("mongo: database not correct configured") | ||
var ErrCollectionNotConfigured = errors.New("mongo: collection not correct configured") | ||
var ErrDocumentIsNotPointer = errors.New("mongo: document param is not a pointer") | ||
var ErrDocumentIsNotStruct = errors.New("mongo: document param is not a struct") | ||
var ErrDocumentIsEmpty = errors.New("mongo: document param is empty") | ||
var ErrDocumentsIsEmpty = errors.New("mongo: documents param is empty") | ||
var ErrDestIsNotPointer = errors.New("mongo: dest param is not a pointer") | ||
var ErrDestIsNotStruct = errors.New("mongo: dest param is not a struct") | ||
var ErrNoDocuments = errors.New("mongo: no documents in result") | ||
var ErrNoOpenSession = errors.New("mongo: no open session") |
Oops, something went wrong.