CSALDatabase Members | CSAL Mongo Access Library |
The CSALDatabase type exposes the following members.
Back to Top
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
CSALDatabase |
To construct an instance of this class, you supply a valid
MongoDB url that includes a database name
(e.g. mongodb://localhost:27017/testdb)
|
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
FindClass |
Return a single class by ID (or null if not found)
| |
FindClasses |
Return all classes in DB
| |
FindLesson |
Return a single lesson by ID (or null if not found)
| |
FindLessonAnswerTots |
Return a dictionary of Lesson ID => (CorrectCount, IncorrectCount)
for all lessons across all students enroller
| |
FindLessonNames |
Return a dictionary of Lesson ID => Lesson Short Names - note that
lessons represent human-created content, so this should be a fairly
low-effort method
| |
FindLessons |
Return all lessons in DB
| |
FindStudent |
Return a single student by ID (or null if not found)
| |
FindStudents |
Return all students in DB
| |
FindStudentsByLocation |
Return a list of students that are at the given location
| |
FindTurns |
Return all turns matching the given lesson and student. Note
that a null or empty string result in no filter.
| |
FindTurnsForStudents |
Return all StudentLessonActs instances that match any of the students given
| |
FindTurnsRaw |
Exactly like FindTurns, but returns the raw BsonDocument
representation of the data. Since we are very liberal in what we
accept in SaveRawStudentActLesson, we might have turn data that
causes exceptions when interpreted with our Model
| |
FindTurnSummary |
Really only for dev view - return a tuple for each StudentLessonActs
instance defined as (LessonID, UserID, TurnCount)
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InsureIndexes |
This very hacky function manually insures all indexes that we want
in the MongoDB collections that we manage. Should really only be
called once in a blue moon. Currently called on app startup by our
web api app.
| |
SaveClass |
Given a class (of students, not an ADT), save it to the database
| |
SaveLesson |
Given a single lesson, save it to the database
| |
SaveRawStudentLessonAct |
Accept a raw JSON data record describing a single CSAL
student/lesson interaction. The JSON record is expected to be in
the format described in the document "CSAL Data". Note that in
practice just about any record format will be saved in an effort
to preserve as much data as possible in the event of a system bug.
HOWEVER, the top-level fields LessonID and UserID MUST be present
| |
SaveStudent |
Given a student instance, save to the database
| |
SaveStudentReadingTarget |
Like our "main" function SaveRawStudentLessonAct, it should be a
JSON object with two fields: UserID and TargetURL.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
CLASS_COLLECTION | MongoDB collection name for classes | |
LESSON_COLLECTION | MongoDB collection name for lessons | |
STUDENT_ACT_COLLECTION | MongoDB collection name for turns (actions) tracked for students/lessons | |
STUDENT_COLLECTION | MongoDB collection name for students |
Properties
Name | Description | |
---|---|---|
ServerURL |
MongoDB URL specifying MongoDB database to target. Note that you
should specify a database in URL (although it is technically
optional in the MongoDB spec)
|
See Also