Computer Science Notes

Notes From CS Undergrad Courses FSU

This project is maintained by awa03

Unstructured Data

Back

XQuery

For-Where-Return

FOR $x IN document["bib.xml"]/bib/book,
$y IN $x/title
WHERE $x/uear/text() > 2020
RETURN $y

This query will project titles and assign them to the y variable. We can avoid using some of these statements by doing something like this

FOR $x IN document("bib.xml")/bib/book[year/text > 2020]
RETURN $x

Mongo DB

Insert / Delete

db.collection.insert(<document>)
db.collection.update(<condition>, <update>)

Find

db.collection.find(<condition>, <update>)
db.collection.findOne(<query>, <projection>)

Delete

db.collection.remove(<query>)

Aggregation

DB.sales.aggregate({group: {
	_id: month, total: { @sum: price }_
}})

Surfaces

We can use the Inclusion Query to find locations contained within a specific polygon. Intersection to get locations that intersect a specific geometry. Proximity to get the points nearest to another point.

Back