Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#if INTERACTIVE
#I @"C:\Tools\MongoDB-CSharp\MongoDB.Linq\bin\Debug"
#r "MongoDB.Driver.dll"
#r "MongoDB.Linq.dll"
#r "FSharp.PowerPack.Linq.dll"
#r "System.Core.dll"
#endif
open System
open MongoDB.Driver
open MongoDB.Linq
open Microsoft.FSharp.Linq.Query
open System.Linq
let mongo = new Mongo()
let connected = mongo.Connect()
let db = mongo.["movieDB"]
db.["movies"].Insert((new Document()).Append("title", "Star Wars").Append("releaseDate", DateTime.Now))
let movies = db.["movies"].AsQueryable() :> IQueryable<Document>
let titles =
query <@ seq { for movie in movies do
yield movie } @>
let disconnected = mongo.Disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment