Этот коммит содержится в:
Ihar Hancharenka 2023-08-12 22:49:22 +03:00
родитель 1686d9bded
Коммит 5224f2a9d9
22 изменённых файлов: 301 добавлений и 2 удалений

Просмотреть файл

@ -1 +1,4 @@
https://www.tutorialspoint.com/mongodb/index.htm
https://www.studytonight.com/mongodb/
6+8+9 parts

17
db/nosql/mongo/features/3 Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
coll
.find({"field1": "v1", ...}, {f1: 1, f2: 0}) // 2-nd - projection
.pretty()
.sort({keyfield: 1/-1, ...})
https://www.studytonight.com/mongodb/sorting-in-mongodb
skip(N).limit(M)
https://www.tutorialsteacher.com/mongodb/cursor
!!! cursor
operators
{$gt: 75}
{ $gte: new ISODate( "2020-01-30" ), $lt: new ISODate( "2022-01-30" ) }
field: {"$exists": false}
???
cur = db.world.find();x=cur.next();print(x["speech"]);

6
db/nosql/mongo/features/administration.txt Обычный файл
Просмотреть файл

@ -0,0 +1,6 @@
https://www.mongodb.com/docs/manual/reference/command/nav-administration/
https://www.mongodb.com/docs/manual/reference/command/killOp/
https://www.mongodb.com/docs/manual/reference/command/currentOp
security
https://www.mongodb.com/docs/manual/reference/privilege-actions/#mongodb-authaction-inprog

37
db/nosql/mongo/features/agg-joins.txt Обычный файл
Просмотреть файл

@ -0,0 +1,37 @@
https://www.mongodb.com/docs/manual/core/aggregation-pipeline/
https://www.mongodb.com/docs/manual/core/aggregation-pipeline-optimization/
https://www.mongodb.com/docs/manual/reference/aggregation/
https://www.mongodb.com/docs/manual/meta/aggregation-quick-reference/
https://www.mongodb.com/docs/manual/reference/operator/aggregation/interface/
commands: aggregate, count, distinct, mapReduce
https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/
stages
https://www.mongodb.com/docs/manual/core/map-reduce/
! deprecated from 5.0
https://www.mongodb.com/docs/manual/reference/operator/aggregation/
https://www.mongodb.com/docs/manual/reference/aggregation-variables/
$$<var-name>
https://www.mongodb.com/docs/manual/reference/sql-aggregation-comparison/
https://www.mongodb.com/docs/manual/tutorial/update-documents-with-aggregation-pipeline/
misc
https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/
from-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/aggregation/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/aggregates/
2015
https://www.mongodb.com/blog/post/joins-and-other-aggregation-enhancements-coming-in-mongodb-3-2-part-2-of-3-worked-examples
https://www.mongodb.com/blog/post/joins-and-other-aggregation-enhancements-coming-in-mongodb-3-2-part-1-of-3-introduction
$lookup (left-outer equi-join)
$match, $project, $lookup, $group, ..., geoNear, unwind, sample, sort, skip(limit number of docs), redact, out
books
https://www.practical-mongodb-aggregations.com/front-cover.html
mongosh
https://www.mongodb.com/docs/manual/reference/method/db.collection.aggregate

1
db/nosql/mongo/features/bulk.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://www.mongodb.com/docs/manual/reference/method/js-bulk/

1
db/nosql/mongo/features/concurrency.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://www.mongodb.com/docs/manual/faq/concurrency/#std-label-faq-concurrency-locking

5
db/nosql/mongo/features/cursors.txt Обычный файл
Просмотреть файл

@ -0,0 +1,5 @@
mongosh
https://www.mongodb.com/docs/manual/tutorial/iterate-a-cursor/
from-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/cursor/

Просмотреть файл

@ -1,4 +1,19 @@
https://www.mongodb.com/docs/manual/reference/method/js-database/
db
<mydb>.help()
<mydb>.drop()
adminCommand({})
getName()
getCollectionNames()
getCollection(collectionName).find()
getCollection(collectionName)
.createCollection
https://www.studytonight.com/mongodb/collection-create-and-drop-mongodb
validation...
.dropDatabase() drop existing db
.runCommand({...})
({ serverStatus: 1 }).metrics.apiVersions
show dbs
use <mydb>

8
db/nosql/mongo/features/inddex.txt Обычный файл
Просмотреть файл

@ -0,0 +1,8 @@
col
.createIndex({field: val, ...})
https://www.studytonight.com/mongodb/indexing-in-mongodb
{<field>: 1}
from-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/indexes/

Просмотреть файл

@ -0,0 +1,4 @@
https://www.mongodb.com/docs/manual/core/read-preference/
https://www.mongodb.com/docs/manual/reference/read-concern/
http://mongodb.github.io/mongo-java-driver/4.10/apidocs/mongodb-driver-core/com/mongodb/ReadConcern.html
https://www.mongodb.com/docs/manual/reference/write-concern/

1
db/nosql/mongo/features/log.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://www.mongodb.com/docs/manual/reference/log-messages/

10
db/nosql/mongo/features/operators.txt Обычный файл
Просмотреть файл

@ -0,0 +1,10 @@
https://www.mongodb.com/docs/manual/core/document/
https://www.mongodb.com/docs/manual/reference/operator/query/
https://www.mongodb.com/docs/manual/reference/operator/update/
https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/
https://www.mongodb.com/docs/manual/reference/operator/aggregation/
$lt
..
$add
$multiply

Просмотреть файл

@ -0,0 +1,65 @@
https://www.mongodb.com/docs/manual/core/query-plans/
https://www.mongodb.com/docs/manual/reference/explain-results/
https://www.mongodb.com/docs/manual/tutorial/analyze-query-plan/
https://www.mongodb.com/docs/manual/administration/analyzing-mongodb-performance/#locking-performance
https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler/
https://www.mongodb.com/docs/manual/reference/database-profiler/
!!! results descr !!!
https://www.mongodb.com/docs/manual/core/capped-collections/
fixed-size for high-thouput
The database profiler writes data in the system.profile capped collection
"planCacheKey"
"planSummary" : "IXSCAN { a: 1, _id: -1 }",
...
"locks"
...
"ts" : ISODate("2019-01-14T23:33:01.806Z"),
"client" : "127.0.0.1",
"appName" : "MongoDB Shell",
"allUsers" : [{"user" : "someuser", "db" : "admin"}],
"user" : "someuser@admin"
https://www.mongodb.com/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile
query-shape
https://www.mongodb.com/docs/manual/reference/glossary/#std-term-query-shape
A combination of query predicate, sort, projection, and collation.
query-hash
https://www.mongodb.com/docs/manual/release-notes/4.2/#std-label-4.2-query-hash
planCache
https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/
options
https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpThresholdMs
slow-op-log
https://www.mongodb.com/docs/manual/reference/configuration-options/#operationprofiling-options
https://www.mongodb.com/docs/manual/reference/method/db.getProfilingStatus
db.getProfilingStatus()
https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel/
(0) - disable
sample
COLSCAN-bad, IXSCAN-good
https://www.mongodb.com/docs/manual/reference/method/db.collection.explain
db.runCommand({explain: { 'find' : 'collection', 'filter' : { 'brandId' : { '$eq' : 'BRND' } }, 'skip' : 0, 'limit' : 0, 'maxTimeMS' : 60000 }})
db.collection.find({"brandId":{"$eq": "BRND"}}).explain()
db.collection.explain().find().help()
.find(...).explain("executionStats")
https://www.mongodb.com/docs/manual/tutorial/analyze-query-plan/
!!!
You can use $comment to add data to the query predicate to make it easier to analyze data from the profiler.
https://www.mongodb.com/docs/manual/reference/operator/query/comment/#mongodb-query-op.-comment
db.setProfilingLevel(2, 0)
db.collection.find( { <query>, $comment: <comment> } )
then -> "comment": "val"
! query plan cache commands
https://www.mongodb.com/docs/manual/reference/command/nav-plan-cache/
!!! cursor.hint
https://www.mongodb.com/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint
from-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/cursor/

11
db/nosql/mongo/features/ref-modelling.txt Обычный файл
Просмотреть файл

@ -0,0 +1,11 @@
https://www.mongodb.com/docs/manual/tutorial/model-embedded-one-to-one-relationships-between-documents/
https://www.mongodb.com/docs/manual/tutorial/model-embedded-one-to-many-relationships-between-documents/
https://www.mongodb.com/docs/manual/tutorial/model-referenced-one-to-many-relationships-between-documents/
tree structures
https://www.mongodb.com/docs/manual/tutorial/model-tree-structures-with-parent-references/
https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/#mongodb-pipeline-pipe.-graphLookup
...
https://www.mongodb.com/docs/manual/tutorial/model-tree-structures-with-nested-sets/
https://www.mongodb.com/docs/manual/reference/database-references/
DBRef

Просмотреть файл

@ -0,0 +1 @@
https://www.mongodb.com/docs/manual/core/schema-validation/

17
db/nosql/mongo/features/search.txt Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
coll
.find({"field1": "v1", ...}, {f1: 1, f2: 0}) // 2-nd - projection
.pretty()
.sort({keyfield: 1/-1, ...})
https://www.studytonight.com/mongodb/sorting-in-mongodb
skip(N).limit(M)
https://www.tutorialsteacher.com/mongodb/cursor
!!! cursor
operators
{$gt: 75}
{ $gte: new ISODate( "2020-01-30" ), $lt: new ISODate( "2022-01-30" ) }
field: {"$exists": false}
???
cur = db.world.find();x=cur.next();print(x["speech"]);

1
db/nosql/mongo/features/transactions.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://www.mongodb.com/docs/manual/core/transactions/

Просмотреть файл

@ -1,2 +1,25 @@
https://www.mongodb.com/docs/manual/tutorial/update-documents-with-aggregation-pipeline/
https://www.mongodb.com/docs/manual/reference/command/nav-crud/
coll
.insertOne({...})
.insertMany([...])
.update,
.updateOne({"field": "...", ...}, [agg-pipeline])
https://www.mongodb.com/docs/manual/tutorial/update-documents-with-aggregation-pipeline/
$set: {"otherField": "otherVal"}
.updateMany
.replaceOne
.queryAndWrite(...)
.deleteOne
.deleteMany
.remove({filer})
from-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/updates/
2022
https://www.fosslinux.com/49919/update-existing-documents-mongodb.htm
bulk
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/write-operations/bulk/

67
db/nosql/mongo/java.txt Обычный файл
Просмотреть файл

@ -0,0 +1,67 @@
https://www.mongodb.com/docs/drivers/java/sync/current/
https://www.mongodb.com/docs/drivers/reactive-streams/
https://mongodb.github.io/mongo-java-driver/
https://mongodb.github.io/mongo-java-driver/4.10/
https://mongodb.github.io/mongo-java-driver/4.10/apidocs/
https://central.sonatype.com/artifact/org.mongodb/mongodb-driver-sync
https://github.com/mongodb/mongo-java-driver
https://www.mongodb.com/docs/drivers/java/sync/current/quick-start/
https://www.mongodb.com/docs/drivers/java/sync/current/quick-reference/
bulks, cursors
https://www.mongodb.com/docs/drivers/java/sync/current/usage-examples/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/databases-collections/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/data-formats/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/data-formats/document-data-format-extended-json/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/data-formats/documents/
https://www.mongodb.com/docs/manual/reference/connection-string/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/stable-api/
db.runCommand( { serverStatus: 1 } ).metrics.apiVersions
client = new MongoClient(uri, { serverApi: { version: '1', strict: true } });
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/retrieve/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/cursor/
...
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/query-document/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/aggregation/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/aggregates/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/filters/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/projections/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/sort/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/updates/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/aggregates/
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/indexes/
plan-explain
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/crud/read-operations/cursor/
https://www.mongodb.com/docs/manual/core/query-plans/
https://www.mongodb.com/docs/manual/reference/explain-results/
pojo-cust-n
https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/data-formats/pojo-customization/
samples
https://www.digitalocean.com/community/tutorials/mongodb-bulk-insert-insertmany
https://www.digitalocean.com/community/tutorials/mongodb-tutorial
api
http://mongodb.github.io/mongo-java-driver/4.10/apidocs/mongodb-driver-core/com/mongodb/ReadConcern.html
2015
https://www.studytonight.com/mongodb/java-integration
https://www.studytonight.com/mongodb/data-insertion-mongodb
https://www.studytonight.com/mongodb/data-updation-mongodb
https://www.studytonight.com/mongodb/retrieve-delete-mongodb

Просмотреть файл

@ -1,5 +1,8 @@
https://www.mongodb.com/try/download/compass
https://www.mongodb.com/docs/compass/current/
https://www.mongodb.com/docs/compass/current/install/
https://www.mongodb.com/docs/compass/current/query/queries
https://www.mongodb.com/try/download/compass
MongoDB Command Line Database Tools Download available as well

Просмотреть файл

@ -5,3 +5,5 @@ https://github.com/mongodb-js/mongosh
sudo apt-get install mongodb-mongosh
mongodb://<usr>:<pwd>@localhost:27017/test
https://www.mongodb.com/docs/manual/reference/method/

1
db/nosql/mongo/vscode.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://code.visualstudio.com/docs/azure/mongodb