Skip to content

Commit ae31dab

Browse files
authored
RUST-1588 Add Namespace and id in GetMoreResult
1 parent 83a2271 commit ae31dab

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/cursor/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ where
163163
if get_more.exhausted {
164164
self.mark_exhausted();
165165
}
166+
if get_more.id != 0 {
167+
self.info.id = get_more.id
168+
}
169+
self.info.ns = get_more.ns;
166170
self.state_mut().buffer = CursorBuffer::new(get_more.batch);
167171
self.state_mut().post_batch_resume_token = get_more.post_batch_resume_token;
168172

src/operation/get_more/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ impl<'conn> OperationWithDefaults for GetMore<'conn> {
9595
batch: response.cursor.next_batch,
9696
exhausted: response.cursor.id == 0,
9797
post_batch_resume_token: ResumeToken::from_raw(response.cursor.post_batch_resume_token),
98+
id: response.cursor.id,
99+
ns: Namespace::from_str(response.cursor.ns.as_str()).unwrap(),
98100
})
99101
}
100102

@@ -118,4 +120,5 @@ struct NextBatchBody {
118120
id: i64,
119121
next_batch: VecDeque<RawDocumentBuf>,
120122
post_batch_resume_token: Option<RawDocumentBuf>,
123+
ns: String,
121124
}

src/results.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::{
66
bson::{serde_helpers, Bson, Document},
77
change_stream::event::ResumeToken,
88
db::options::CreateCollectionOptions,
9+
Namespace,
910
serde_util,
1011
};
1112

@@ -108,6 +109,8 @@ pub(crate) struct GetMoreResult {
108109
pub(crate) batch: VecDeque<RawDocumentBuf>,
109110
pub(crate) exhausted: bool,
110111
pub(crate) post_batch_resume_token: Option<ResumeToken>,
112+
pub(crate) ns: Namespace,
113+
pub(crate) id: i64,
111114
}
112115

113116
/// Describes the type of data store returned when executing

0 commit comments

Comments
 (0)