good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
upper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
open
upper
Commits
a96d36bc
"git@gfx.cafe:open/bor.git" did not exist on "15e6c27f8bcc6a30b47b956701d70f5eb14c1b7c"
Commit
a96d36bc
authored
Jun 19, 2012
by
José Carlos Nieto
Browse files
Options
Downloads
Patches
Plain Diff
Drafting documentation.
parent
b51c740a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/db.go
+70
-3
70 additions, 3 deletions
db/db.go
with
70 additions
and
3 deletions
db/db.go
+
70
−
3
View file @
a96d36bc
...
...
@@ -23,21 +23,86 @@
package
db
// "Where" is a keytype that can handle conditions and operators in an expression.
// Examples:
// Where { "age": 18 } // Means the condition is to have the "age" field equal to 18.
// Where { "age $lt": 18 } // $lt is a MongoDB operator, if you're using MongoDB, means that you want the "age" field to be lower than 18.
// Where { "age >=": 18 } // >= is a SQL operator, if you're using SQL, means that you want the "age" field to be mayor or equal to 18.
type
Where
map
[
string
]
interface
{}
// "And" is a keytype that can handle "And", "Or" and "Where" types in an expression.
// Example:
// And (
// Where { "name": "Peter" },
// Where { "last_name": "Parker "},
// )
type
And
[]
interface
{}
// "Or" is a keytype that can handle "And", "Or" and "Where" types.
// Example:
// Or (
// Where { "year": 2012 },
// Where { "year": 1987 },
// )
type
Or
[]
interface
{}
// "Sort" is a keytype for determining the order of the returning Items in Find() or FindAll() expressions.
// Example:
// Sort { "age": -1 } // If using MongoDB, means sort by age in descending order.
// Sort { "age": "ASC" } // If using SQL, means sort by age in ascending order.
type
Sort
map
[
string
]
interface
{}
// "Modify" is a keytype that determine values that are going to change in Update() and UpdateAll() expressions.
// Example:
// Modify {
// "name": "New Name"
// }
type
Modify
map
[
string
]
interface
{}
// "On" is a keytype that specifies relations with external collections, the specific relation with the parent expression can be
// determined with the name of field on the external collection plus the name of the referred parent column between brackets,
// however this can be only used along with Where keytypes.
// Example:
// On {
// db.Collection("external"),
// Where { "external_key": "{parent_value}" }, // Relation exists where the "external_key" field is equal to the parent's "parent_value".
// }
type
On
[]
interface
{}
// "Relate" is a keytype that specifies a one-to-one relation in Find() and FindAll() expressions. It consists of a name and an On keytype.
// You can use the same keytypes you would use in a normal Find() and FindAll() expressions besides a Collection, you can also use
// other nested Relate and RelateAll statements. If no Collection is given, the one with the relation name will be tried.
// Example:
// Relate {
// "father": On {
// db.Collection("people"),
// Where { "gender": "man" },
// Where { "id": "{parent_id}" },
// }
// }
type
Relate
map
[
string
]
On
type
RelateAll
map
[
string
]
On
type
Multi
bool
type
CountFlag
bool
// "RelateAll" is a keytype that specifies a one-to-many relation in Find() and FindAll() expressions. It consists of a name and an On keytype.
// You can use the same keytypes you would use in a normal Find() and FindAll() expressions besides a Collection, you can also use
// other nested Relate and RelateAll statements. If no Collection is given, the one with the relation name will be tried.
// Example:
// RelateAll {
// "children": On {
// db.Collection("people"),
// Where { "age $lt": 12 },
// Where { "parent_id": "{_id}" },
// }
// }
type
RelateAll
map
[
string
]
On
// "Limit" is a keytype that limits the number of results a FindAll() expression returns.
// Example:
// Limit(10)
type
Limit
uint
// "Offset" is a keytype that specifies how many matched results will be skipped in a FindAll() expression before returning.
// Example:
// Offset(10)
type
Offset
uint
type
Set
map
[
string
]
interface
{}
...
...
@@ -79,3 +144,5 @@ type Collection interface {
Truncate
()
bool
}
type
Multi
bool
type
CountFlag
bool
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment