Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed coffee file

  • Loading branch information...
commit 4ff6eeaa91ad558e719781e775e3355448f79eb6 1 parent 5f7872d
@jamescarr authored
Showing with 0 additions and 44 deletions.
  1. +0 −44 gridfs.coffee
View
44 gridfs.coffee
@@ -1,44 +0,0 @@
-mongoose = require("mongoose")
-debug = require("debug")("gridfs")
-assert = require("better-assert")
-
-GridStore = mongoose.mongo.GridStore
-Grid = mongoose.mongo.Grid
-
-exports.get = (id, fn) ->
- ##debug "fetching %s", id
- db = mongoose.connection.db
- id = new mongoose.mongo.BSONPure.ObjectID(id)
- store = new GridStore(db, id, "r",{root: "fs"})
- store.open (err, store) ->
- assert not err
- return fn(err) if err
- store.readBuffer fn
-
-exports.put = (buf, name, fn) ->
- db = mongoose.connection.db
- ##debug "saving %d bytes as %s", buf.length, name
- new GridStore(db, name, "w").open (err, file) ->
- assert not err
- return fn(err) if err
- file.write buf, true, fn
-
-exports.putFile = (path, name, fn) ->
- db = mongoose.connection.db
- ##debug "saving %s as %s", path, name
- new GridStore(db, name, "w").open (err, file) ->
- assert not err
- return fn(err) if err
- file.writeFile path, fn
-
-exports.deleteFile = (id, fn) ->
- console.log "deleting " + id
- db = mongoose.connection.db
- id = new mongoose.mongo.BSONPure.ObjectID(id)
- store = new GridStore(db, id, "r",{root: "fs"})
- store.unlink (err, result) ->
- if err
- console.log err
- return fn(err) if err
- return true
-
Please sign in to comment.
Something went wrong with that request. Please try again.