Skip to content

Commit a773621

Browse files
authored
Merge pull request #49 from terakilobyte/DOCSP-9556
Docsp 9556
2 parents 3b41410 + a61cf71 commit a773621

File tree

13 files changed

+112
-27
lines changed

13 files changed

+112
-27
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "java"
22
title = "Java"
3-
toc_landing_pages = ["/fundamentals/connection"]
3+
toc_landing_pages = ["/fundamentals/connection", "/fundamentals/crud"]
44

55
[constants]
66
version = 4.0

source/fundamentals/crud.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
2-
====
3-
CRUD
4-
====
1+
===============
2+
CRUD Operations
3+
===============
54

65
.. default-domain:: mongodb
76

87
.. toctree::
9-
:titlesonly:
10-
:maxdepth: 1
8+
:caption: CRUD Operations
9+
10+
/fundamentals/crud/read-operations
11+
/fundamentals/crud/write-operations
12+
13+
CRUD (Create, Read, Update, Delete) operations enable you to work with
14+
data stored in MongoDB.
15+
16+
- :doc:`Read Operations </fundamentals/crud/read-operations>` find and return
17+
documents stored in your database.
18+
- :doc:`Write Operations </fundamentals/crud/write-operations>` insert, modify,
19+
or delete documents in your database.
1120

12-
/fundamentals/crud/read
13-
21+
..
22+
Some operations combine aspects of read and write operations. See our
23+
guide on :doc:`compound operations </fundamentals/crud/compound-operations>`
24+
to learn more about these hybrid methods.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
===============
2+
Read Operations
3+
===============
4+
5+
.. default-domain:: mongodb
6+
7+
- :doc:`/fundamentals/crud/read-operations/cursor`
8+
- :doc:`/fundamentals/crud/read-operations/sort`
9+
- :doc:`/fundamentals/crud/read-operations/limit`
10+
11+
..
12+
- :doc:`/fundamentals/crud/read-operations/retrieve`
13+
- :doc:`/fundamentals/crud/read-operations/skip`
14+
- :doc:`/fundamentals/crud/read-operations/project`
15+
- :doc:`/fundamentals/crud/read-operations/geo`
16+
- :doc:`/fundamentals/crud/read-operations/text`
17+
18+
.. toctree::
19+
:caption: Read Operations
20+
21+
/fundamentals/crud/read-operations/cursor
22+
/fundamentals/crud/read-operations/sort
23+
/fundamentals/crud/read-operations/limit
24+
..
25+
/fundamentals/crud/read-operations/skip
26+
/fundamentals/crud/read-operations/retrieve
27+
/fundamentals/crud/read-operations/project
28+
/fundamentals/crud/read-operations/geo
29+
/fundamentals/crud/read-operations/text
30+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=========================
2+
Access Data From a Cursor
3+
=========================
4+
5+
.. default-domain:: mongodb
6+
7+
Read operations that return multiple documents do not immediately return
8+
all values matching the query.

source/fundamentals/crud/read/limit.txt renamed to source/fundamentals/crud/read-operations/limit.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Limit the Number of Returned Results
44

55
.. default-domain:: mongodb
66

7-
Use ``limit()`` to cap the number of documents that a read operation returns.
7+
Use ``limit()`` to cap the number of documents that a read operation returns.
88
This instance method designates the maximum number of
99
documents that a read operation can return. If there are not enough documents
10-
to reach the specified limit, it can return a smaller number.
10+
to reach the specified limit, it can return a smaller number.
1111
If you use ``limit()`` with the ``skip()`` (TODO: link) instance method, the skip applies
1212
first and the limit only applies to the documents left over after
1313
the skip.
1414

1515
The examples below demonstrate, respectively, how to insert data into
1616
a collection, how to use ``limit()`` to restrict the number of returned documents,
17-
and how to combine ``limit()`` with ``skip()`` to further narrow the results returned from a query.
17+
and how to combine ``limit()`` with ``skip()`` to further narrow the results returned from a query.
1818

1919
The following operation inserts documents representing books into a collection:
2020

@@ -57,7 +57,7 @@ books with shorter lengths. Lastly, it limits the return value to ``3`` document
5757
while (cursor.hasNext()) {
5858
System.out.println(cursor.next());
5959
}
60-
}
60+
}
6161
// close the cursor
6262
finally {
6363
cursor.close();
@@ -85,7 +85,7 @@ length:
8585
collection.find().limit(3).sort(descending("length"));
8686

8787

88-
To see the next three longest books, append the ``skip()`` method to your
88+
To see the next three longest books, append the ``skip()`` method to your
8989
``find()`` call. The integer argument passed to ``skip()`` will determine
9090
how many documents the find operation returns:
9191

@@ -119,8 +119,8 @@ collection, returning only small subsets of the collection at one time.
119119

120120
For example, consider the following data:
121121

122-
.. code_block:: java
123-
122+
.. code-block:: java
123+
124124
{ type: "computer", data: "1", serial_no: 235235 }
125125
{ type: "computer", data: "2", serial_no: 235237 }
126126
{ type: "computer", data: "3", serial_no: 235239 }

source/fundamentals/crud/read.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

source/fundamentals/crud/read/geospatial.txt

Whitespace-only changes.

source/fundamentals/crud/read/search.txt

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
================
2+
Write Operations
3+
================
4+
5+
.. default-domain:: mongodb
6+
7+
- :doc:`/fundamentals/crud/write-operations/insert`
8+
- :doc:`/fundamentals/crud/write-operations/upsert`
9+
10+
..
11+
- :doc:`/fundamentals/crud/write-operations/delete`
12+
- :doc:`/fundamentals/crud/write-operations/change-a-document`
13+
- :doc:`/fundamentals/crud/write-operations/embedded-arrays`
14+
15+
.. toctree::
16+
:caption: Write Operations
17+
18+
/fundamentals/crud/write-operations/insert
19+
/fundamentals/crud/write-operations/upsert
20+
21+
..
22+
/fundamentals/crud/write-operations/delete
23+
/fundamentals/crud/write-operations/change-a-document
24+
/fundamentals/crud/write-operations/embedded-arrays

0 commit comments

Comments
 (0)