2016-05-05 14 views
0

Ich habe vor kurzem begonnen, Python zu verwenden. Ich habe eine Datenbank namens Student in Couchdb. Ich habe Attribute darin wie [Englisch, Mathematik, Wissenschaft, Gesamt-, Prozent]. Ich möchte alle Dokumente aus meiner Schülerdatenbank mit Python anzeigen. Ich kann nicht auf alle Dokumente zugreifen. Ich habe versucht, folgenden Code aber nicht funktioniert hatWie alle Dokumente in Couchdb mit Python angezeigt werden

couch = couchdb.Server() 
db = couch['student'] 
rows = db.view('_all_docs', include_docs=True) 
for row in rows: 
    doc = db.get(row) 
    print(doc['english']) 

Antwort

0
import couchdb 
couch = couchdb.Server('localhost:5984/') 

db = couch['newtweets'] 
count = 0 
for docid in db.view('_all_docs'): 
    i = docid['id'] 
#and you are in each document 
Verwandte Themen