将多个内容CSS文件添加到CKEditor(Adding multiple content CSS files to CKEditor)
如何在CKEditor中使用超过1个CSS文件作为内容CSS? 我已经在配置中添加了bootstrap css。
config.contentsCss = '/css/bootstrap.min.css';
我们的设计师创建了第二个CSS来定制一些东西,我也需要将该CSS文件添加到CKEditor。
我尝试了下面的变化,但到目前为止没有成功:
config.contentsCss = '/css/bootstrap.min.css', '/css/styles.css'; config.contentsCss = '/css/bootstrap.min.css, /css/styles.css';
我正在使用v 4.1.1
How can I use more than 1 css file as content CSS with CKEditor? I already added bootstrap css in the config.
config.contentsCss = '/css/bootstrap.min.css';
Our designer created a 2nd css to customize some stuff and I also need to add that css file to CKEditor.
I tried variations below, but no success so far:
config.contentsCss = '/css/bootstrap.min.css', '/css/styles.css'; config.contentsCss = '/css/bootstrap.min.css, /css/styles.css';
I am using v 4.1.1
原文:https://stackoverflow.com/questions/29433760
最满意答案
您可以使用MongoDB聚合框架 。
这是一个查询,它会以所需的形式为您提供日期。 不过,我相信会有一些更好的和有效的方式来处理这个问题,但这是我想出的。
db.collection.aggregate([ {"$unwind":"$class"}, {"$unwind":"$class.people"}, {"$match": { "class.people.name":"Susan" } }, {"$group":{ "_id":"$class.people.name", "classes":{"$push":"$class.name"} } } ])
结果: -
{ "_id" : "Susan", "classes" : [ "class 1", "class 2" ] }
在
$unwind
操作之前尝试$match
,以避免$unwind
之前的管道中产生不必要的结果。请参阅聚合管道优化以提高性能。
You can make use of MongoDB aggregation framework.
Here is a query which will give you the date in the desired form. However, I believe that there will be some better and efficient way to handle this but this is what I came up with.
db.collection.aggregate([ {"$unwind":"$class"}, {"$unwind":"$class.people"}, {"$match": { "class.people.name":"Susan" } }, {"$group":{ "_id":"$class.people.name", "classes":{"$push":"$class.name"} } } ])
Result :-
{ "_id" : "Susan", "classes" : [ "class 1", "class 2" ] }
Try to
$match
before first$unwind
operation to avoid the unnecessary results in the pipeline before$unwind
.Refer Aggregation Pipeline Optimization for improved performance.
相关问答
更多-
得到它了: db.post.find({'author.$id': 'foo'}) Got it: db.post.find({'author.$id': 'foo'})
-
那必须是: db.users.find({"name": /.*m.*/}) 或类似: db.users.find({"name": /m/}) 你正在寻找包含“m”的东西(SQL的' % '运算符等价于Regexp的' .* '),而不是“m”锚定到字符串的开头。 That would have to be: db.users.find({"name": /.*m.*/}) or, similar: db.users.find({"name": /m/}) You're looking for s ...
-
你正在运行的查询没有给出正确的结果? 你使用的是什么版本的MongoDB? 您的$not查询不是MongoDB 2.6中的有效查询: > db.amon.find({ "$not" : { "code" : /^AAA/, "name" : { "$in" : ["BB", "CC"] } } }) error: { "$err" : "Can't canonicalize query: BadValue unknown top level operator: $not", "code" : ...
-
PHP MongoDB查找查询(PHP MongoDB find query)[2022-09-28]
也许$currentId是错误的类型? 看看你想要做什么,我认为它应该是MongoId实例 Maybe $currentId is of wrong type? Looking at what you're trying to do I think it should be instance of MongoId -
默认情况下,MongoDB将返回整个文档。 如果您只需要文档的一部分,则可以使用投影 。 尝试这个: db.prueba1.find({}, {mercancia: 1}) 它应该返回: { { _id: id-of-doc-one, mercancia: { ... } }, { _id: id-of-doc-two, mercancia: { ... } }, { _id: id-of-doc-three, mercancia: { ... } } } 如果你想要一个特定文件的merca ...
-
您可以使用MongoDB聚合框架 。 这是一个查询,它会以所需的形式为您提供日期。 不过,我相信会有一些更好的和有效的方式来处理这个问题,但这是我想出的。 db.collection.aggregate([ {"$unwind":"$class"}, {"$unwind":"$class.people"}, {"$match": { "class.people.name":"Susan" } }, {"$group":{ "_id":"$class. ...
-
正如Mongo最LIKE是正则表达式: db.my_collection.find({nm: /amet/}) 但我不认为你可以做你要求的,除非你可以编写一个捕获查询的包含和不包含部分的正则表达式。 也就是说,就像LIKE ,Mongo的正则表达式查询不具备性能。 如果您需要全文搜索,您应该查看像Solr或内置全文索引的数据库。 MY SOLUTION array( 'nm' => array( '$all' => array(new MongoRegex('/amet/'), ...), ...
-
MongoDB Like Query(起始字母或单词查找查询)(MongoDB Like Query (starting letter or word find query))[2022-10-19]
这是一般的正则表达式问题,应该是可搜索的 /^test/ ^插入符号表示该行的开始。 在mongo中也建议从一开始就进行搜索以提高效率,这意味着避免收集扫描。 有关此形式的更多信息,请参阅文档中的$ regex 。 将此作为书签,以及您可能需要的任何其他更改的参考。 http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/ This is a general regex question and should be se ... -
我相信这个问题就是这样的。 我认为'desc'不是有效值,你可以尝试用-1替换它: { created: -1 } (我刚刚在这里测试了'desc'并得到了"$err" : "Can't canonicalize query: BadValue bad sort specification" ) 也许你Mongodb得到了更新,它停止了工作? So, I found my problem, I just need to update all my node module package, mainly mo ...
-
好吧,6年前在php工作,但我认为你的$和运算符应该接受一系列查询, 像array('$and' => array(array('build_version' => array('$gte'=> (int)$version[2])), array('sub_version' => (int)$version[1])) '和'接受数组,因为你正在为'或'opeartor做,在这里你传递查询而不是数组。 Well, worked in php 6 years back but I think your $and ...