[DOCS-674] Tailiable Cursors Page Created: 25/Oct/12 Updated: 13/Nov/23 Resolved: 20/Dec/12 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | v1.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Sam Kleinman (Inactive) | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 11 years, 8 weeks, 5 days ago |
| Description |
|
http://www.mongodb.org/display/DOCS/Tailable+Cursors This should probably be a new page. Probably a tutorial and a page in core/applications. |
| Comments |
| Comment by auto [ 22/Dec/12 ] |
|
Author: {u'date': u'2012-12-20T19:36:00Z', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 22/Dec/12 ] |
|
Author: {u'date': u'2012-12-20T18:59:47Z', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by auto [ 22/Dec/12 ] |
|
Author: {u'date': u'2012-12-14T05:39:58Z', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by auto [ 22/Dec/12 ] |
|
Author: {u'date': u'2012-12-14T04:28:14Z', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by auto [ 22/Dec/12 ] |
|
Author: {u'date': u'2012-12-07T17:20:21Z', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by Kay Kim (Inactive) [ 20/Dec/12 ] |
|
Removed the javascript example per Scott's okay This example spawns gazillions of cursors – can check via db.runCommand( { cursorInfo: 1 }) var coll = db.myCappedCollection; var startDoc = coll.find().hint( { '$natural': 1 } ).limit(1).next(); while (1) { var cursor = coll.find( { 'insertDate' : { '$gt' : lastValue }} ).hint( { '$natural': 1 }).addOption( DBQuery.Option.tailable ).addOption( DBQuery.Option.awaitData ); while ( cursor.hasNext() ) { var doc = cursor.next(); lastValue = doc['insertDate']; printjson(doc); }} — var coll = db.myCappedCollection; var startDoc = coll.find().hint( { '$natural': 1 } ).limit(1).next(); var cursor = coll.find( { 'insertDate' : { '$gt' : lastValue } } ).addOption( DBQuery.Option.tailable ).addOption( DBQuery.Option.awaitData ); while (1) { } catch (e) { break; }} |