Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/courses-core'
Browse files Browse the repository at this point in the history
  • Loading branch information
yashdiniz committed Mar 7, 2021
2 parents 3160d60 + acbf8e3 commit c4c0b81
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions server/services/courses/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { logs, courses, assert } = require('../databases');

var PouchDB = require("pouchdb");

function addcourse(name, description, mods){


}

// document that tells PouchDB/CouchDB
// to build up an index on doc.name
var ddoc = {
_id: '_design/my_index',
views: {
by_name: {
map: function (doc) { emit(doc.name); }.toString(),
reduce: '_count'
}
}
};
// save it
courses.put(ddoc).then(function () {
// success!s
}).catch(function (err) {
// some error (maybe a 409, because it already exists?)
});

0 comments on commit c4c0b81

Please sign in to comment.