Comments (9)
One question: how do you verify that metadata is not set? I will take a look
from monger.
thanks using mongo js console db.fs.files.findOne({filename:basename})
from monger.
So far I could not reproduce this. I improved test coverage for monger.gridfs (GridFS definitely needs some love in Monger, sorry about that) and the metadata I store is there.
With a small app that looks like this:
(ns monger-i27.core
(:require [monger.core :as mg]
[monger.collection :as mc]
[monger.gridfs :as mfs])
(:use monger.conversion))
(defn -main
[& args]
(mg/connect!)
(mg/set-db! (mg/get-db "monger_issue27"))
(let [path (first args)
fname "created.by.monger.bin"]
(println "Storing " path)
(mfs/store (mfs/make-input-file path)
(.setFilename fname)
(.setMetaData (to-db-object {:some "metadata"})))
(println "Done")
(println (mfs/files-as-maps {:filename fname}))))
I get this (shell history):
All namespaces already :aot compiled.
Storing /Users/antares/.gitignore
Done
({:_id #<ObjectId 4fcc7e6503649fbe0af95482>, :chunkSize 262144, :length 427, :md5 1942f1e69c1d7354f93e2cf805894a9c, :filename created.by.monger.bin, :contentType nil, :uploadDate #<Date Mon Jun 04 13:22:45 MSK 2012>, :aliases nil, :metadata {:some metadata}} {:_id #<ObjectId 4fcc7ef6036404fb33e6d31c>, :chunkSize 262144, :length 427, :md5 1942f1e69c1d7354f93e2cf805894a9c, :filename created.by.monger.bin, :contentType nil, :uploadDate #<Date Mon Jun 04 13:25:10 MSK 2012>, :aliases nil, :metadata {:some metadata}})
/tmp/monger-i27 mongo monger_issue27
MongoDB shell version: 2.0.5
connecting to: monger_issue27
> db.fs.files.findOne({filename: "created.by.monger.bin"})
{
"_id" : ObjectId("4fcc7e6503649fbe0af95482"),
"chunkSize" : NumberLong(262144),
"length" : NumberLong(427),
"md5" : "1942f1e69c1d7354f93e2cf805894a9c",
"filename" : "created.by.monger.bin",
"contentType" : null,
"uploadDate" : ISODate("2012-06-04T09:22:45.634Z"),
"aliases" : null,
"metadata" : {
"some" : "metadata"
}
}
from monger.
By the way, files-as-maps
is a function I just added. I am pushing a new snapshot that will have it.
from monger.
many thanks for adding some love to gridfs. works great
from monger.
@locojay can I close this?
from monger.
closed
from monger.
Thanks. I will release a new beta in about a day.
from monger.
By the way, a new doc guide is up: Using GridFS with Clojure
from monger.
Related Issues (20)
- Support for lookup and graphLookup HOT 1
- Execution Stats in Aggregate HOT 2
- mongo-options missing option setters
- Can't find a codec for class java.time.Instant. HOT 6
- Monger find-maps not returning any items in the collection
- Array Query returning empty result HOT 1
- Pagination returning the same keys in monger
- Message: bad query: BadValue: unknown top level operator: $ne HOT 1
- Question: Mongodb+srv HOT 2
- Type hint mismatch
- support for MongoDB 5.0 ?
- mongo-options-builder does not support uuidRepresentation option HOT 3
- Clojure 1.11 warning on `random-uuid`
- Documentation about $pushAll being deprecated not updated on website HOT 1
- Improve developer experience by avoiding "Unresolved var" warnings by clj-kondo HOT 2
- Serverless Mongo (Atlas) is not supported = A TXT record is only permitted to contain the keys [authsource, replicaset] HOT 1
- Latest version uses MongoDB java driver 3.12 which only supports MongoDB up to 4.2, which is out of support this coming April 2023.... **SOLVED** HOT 2
- Cannot delete a object HOT 1
- Freeze on `ensure-index` HOT 1
- Missing support for new version artifacts from mongodb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monger.