-
Notifications
You must be signed in to change notification settings - Fork 29
DOCSP-45192-read-data-page #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gmiller-mdb
merged 11 commits into
mongodb:standardization
from
gmiller-mdb:DOCSP-45192-read-data-page
Jan 16, 2025
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ec0e90f
DOCSP-45192-read-data-page
gmiller-mdb 76a5b40
wrote page
gmiller-mdb 95656ca
fix links
gmiller-mdb 52e16a6
last link fix
gmiller-mdb 6603cd6
feedback
gmiller-mdb 2e73d11
fix link
gmiller-mdb c8930a5
feedback
gmiller-mdb 88e62fa
DOCSP-45192-read-data-page
gmiller-mdb 3e8cc97
quotes
gmiller-mdb c33457b
label
gmiller-mdb 8f8396d
link
gmiller-mdb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,45 @@ | ||
require 'bundler/inline' | ||
|
||
gemfile do | ||
source 'https://rubygems.org' | ||
gem 'mongo' | ||
end | ||
|
||
uri = '<connection string>' | ||
|
||
Mongo::Client.new(uri) do |client| | ||
|
||
# start-find-one | ||
document = collection.find(name: "<value>").first | ||
puts document | ||
# end-find-one | ||
|
||
# start-find-many | ||
results = collection.find(founded_year: "<value>") | ||
# end-find-many | ||
|
||
# start-count-collection | ||
result = collection.count_documents | ||
puts "Number of documents: #{result}" | ||
# end-count-collection | ||
|
||
# start-count-accurate | ||
result = collection.count_documents("key": "<value>") | ||
puts "value: #{result}" | ||
# end-count-accurate | ||
|
||
# start-count-estimate | ||
result = collection.estimated_document_count | ||
puts "Estimated number of documents: #{result}" | ||
# end-count-estimate | ||
|
||
# start-distinct | ||
results = collection.distinct("field") | ||
# end-distinct | ||
|
||
# start-monitor-changes | ||
stream = collection.watch | ||
collection.insert_one(a: 1) | ||
doc = stream.to_enum.next | ||
process(doc) | ||
# end-monitor-changes |
This file contains hidden or 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,23 @@ | ||
require 'bundler/inline' | ||
|
||
gemfile do | ||
source 'https://rubygems.org' | ||
gem 'mongo' | ||
end | ||
|
||
uri = '<connection string>' | ||
|
||
Mongo::Client.new(uri) do |client| | ||
database = client.use('<database name>') | ||
collection = database['<collection name>'] | ||
|
||
# Start example code here | ||
|
||
# End example code here | ||
|
||
# Wait for the operations to complete before closing client | ||
# Note: This example uses sleep for brevity and does not guarantee all | ||
# operations will be completed in time | ||
sleep(1) | ||
gmiller-mdb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
client.close | ||
gmiller-mdb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
end |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.