-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tutorial: Simple Connection #2
Conversation
This is to avoid collision with the simpler "connect" tutorial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with tracing disabled. Not needed in this PR, but I request adding an example to show a CRUD operation (insert/find), which I expect most users would want to try.
fprintf(stderr, "Error while connecting to server: %s\n", msg); | ||
free(msg); | ||
} else { | ||
printf("Successfully connected!\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest disabling the default enabled tracing. This example currently prints the full OPMSG sent and received:
send OP_MSG #0 (135 bytes)
Section #1 body: {
"hello": 1:i32,
"$db": "admin",
"client": {
"driver": {
"name": "amongoc",
"version": "experimental-dev",
},
"os": { "type": "Linux" },
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how that got in. Oop.
This adds a very basic tutorial for connecting to a server, distinct from the more complex "communicating" how-to page.
This also adds several convenience APIs that make code much easier to read/write:
amongoc_{then,let,just}
for common parameter sets.amongoc_detach_start
for when you don't care about the operation state storage.