我想搜索部分名字和姓氏匹配 - 例如在sql中
f_name LIKE J% OR l_name LIKE S%
Run Code Online (Sandbox Code Playgroud)
会与John Smith或John Henry或Harry Smith相匹配.
我假设我可能需要使用"$或"运算符,
到目前为止,我已经相信我正在做正确的LIKE%部分,但我相信它正在进行"AND"搜索(意味着它搜索f_name LIKE J%和l_name LIKE S%,因此它只匹配John Smith):
$name1="J";
$name2="S";
$cursor = $this->clientCollection->find(array('f_name' => new MongoRegex('/^'.$name1.'/i'), 'l_name' => new MongoRegex('/^'.$name2.'/i') ));
Run Code Online (Sandbox Code Playgroud)
注意:这将匹配%J%
MongoRegex('/'.$name1.'/i')
Run Code Online (Sandbox Code Playgroud)
这将匹配开头(注意添加的^),如J%
MongoRegex('/^'.$name1.'/i')
Run Code Online (Sandbox Code Playgroud) 有没有人使用 BIRT 从 MongoDB 生成报告,你能描述一下如何,任何问题等吗?
看起来可以使用 JDBC 和这个实验性驱动程序进行接口:https : //github.com/erh/mongo-jdbc
但是,我不确定如何在 Eclipse 中安装此驱动程序以对其进行测试。
如何创建商店的唯一实例并将其分配给视图(如果需要,我可以创建独特的视图和/或控制器)?
一个简单的用例 - 我想打开多个网格(相同类型),每个网格包含一个商店中的记录列表.每个网格都需要拥有自己的商店实例,因为它可以拥有自己的记录列表,它自己的过滤等等.
我尝试了这个,但它不起作用,我的网格不绘制:
var theView = Ext.create('App.view.encounter.List');
theView.title = 'WORC Encounters';
var theStore=Ext.create('App.store.Encounters');
theView.store=theStore;
tabhost.add({title:'WORC',items:theView});
var theView = Ext.create('App.view.encounter.List');
theView.title = 'NC Encounters';
var theStore2=Ext.create('App.store.Encounters');
theView.store=theStore2;
tabhost.add({title:'NC',items:theView});
Run Code Online (Sandbox Code Playgroud) 我有一些使用ArrayCollection的代码,它导入:
import mx.collections.ArrayCollection;
Run Code Online (Sandbox Code Playgroud)
然后:
static protected var myAC:ArrayCollection = new ArrayCollection();
Run Code Online (Sandbox Code Playgroud)
看起来很简单,但在我的项目中,找不到/定义了导入(以及ArrayCollection)!
我使用的是Flash Builder 4(Flex 4) - 它是一个ActionScript项目,项目属性设置为Flex SDK 4.0.一切都应该是默认设置.
当我输入"import mx"时.并按控制空间(自动完成),我看到一个选项列表,如核心,几何和其他几个,但没有'集合'.
我肯定错过了什么?
apache-flex actionscript-3 arraycollection flash-builder flex4
我试图在flex中创建一个简单的表单(flash builder 4).我在里面放了一个表单容器和FormItems.表单项例如是标准的"客户"字段,例如First,Last,Address,City,State,Zip.
默认情况下,它将字段垂直放置并使字段标签右对齐,这看起来不错.
但是,我希望某些字段是水平的 - 例如,像这样:
First __________ Last ___________
Address _____________________
City ___________ St ___ Zip ____
Run Code Online (Sandbox Code Playgroud)
我尝试将第一个/最后一个放在HGroup容器中,但这不太合适 - 我放弃了标签的正确理由,看起来像这样:
First __________ Last ___________
Address _____________________
City ___________ St ___ Zip ____
Run Code Online (Sandbox Code Playgroud)
这是我如何尝试制作第一个/最后一个水平的一个例子,但它不会通过推荐来证明 - 但是城市和推荐是合理的:
<mx:Form x="0" y="307" width="100%">
<s:HGroup>
<mx:FormItem label="First"> <s:TextInput/></mx:FormItem>
<mx:FormItem label="Last"><s:TextInput/></mx:FormItem>
</s:HGroup>
<mx:FormItem label="Referral"><s:TextInput/></mx:FormItem><mx:FormItem label="City">
<s:TextInput/>
</mx:FormItem>
</mx:Form>
Run Code Online (Sandbox Code Playgroud)
这几乎就像我需要一种具有colSpan能力的表格布局,或者?
这个自定义组件看起来很有前途,但似乎无法在fb4中运行至少http://cookbooks.adobe.com/post_Multi_Column_Form_Layout-9644.html
此外,是否有任何好的书籍/网站/等讨论用户界面设计/表单设计和类似的Flex我可以浏览?
这叫什么?
List<String> ids = new ArrayList<String>(sectionIDs);
Run Code Online (Sandbox Code Playgroud)
(<>的部分)
我知道这是一个较新的java功能,我只是想不起这个名字.
我在视图中有一个组合框,它与使用Ext.Direct加载下拉数据的数据存储/模型相关联.
在我打开包含组合框的视图的控制器中,我启动了商店的负载.
这一切都有效,但是当我点击组合框时,它会启动另一个加载(用加载掩盖屏幕)并重新加载商店.我需要防止第二次加载,因为它已经加载了.
商店:
Ext.define('ESDB.store.Employees', {
extend: 'Ext.data.Store',
model: 'ESDB.model.Employee',
autoLoad:false,
proxy: {
type: 'direct',
api: {
create : undefined,
read : EmployeeService.getRecords,
update : EmployeeService.setRecord,
destroy : undefined
}
}
});
Run Code Online (Sandbox Code Playgroud)
模型:
Ext.define('ESDB.model.Employee', {
extend: 'Ext.data.Model',
fields: ['id','name','login','pw','domain','lastLogin','addedDate','active','ulevel','staffID']
});
Run Code Online (Sandbox Code Playgroud)
视图:
(相关部分 - 组合框 - 视图中没有其他对商店或模型的引用)
this.items = [
{
xtype: 'form',
items: [
{
xtype: 'combobox',
name : 'callTakenBy',
fieldLabel: 'Taken By',
displayField: 'name',
queryMode: 'remote',
valueField: 'id',
store: "Employees",
editable: false
}
]]}
Run Code Online (Sandbox Code Playgroud)
控制器(当他们双击网格中的一行时,它会启动员工商店的负载,然后打开视图):
encounterRowClicked: function(grid, record) { …Run Code Online (Sandbox Code Playgroud) 如果我在MongoDB中有一个dob(出生日期)字段,该如何查询出生日期小于1990年1月1日(字符串)或小于特定年龄的所有记录?
我在窗口内有一个简单的ExtJS 4(xtype形式).它有两个字段和一个保存按钮.其中一个字段是字符串.这很好.如果它是空白的,则getValues()会将该字段留空.如果设置了,我就得到了价值.但是,复选框不同.如果选中它,我会得到'1'的值.不过,如果我取消勾选框(或不检查的话),我没有得到任何价值 - 域不在的GetValues的结果上市()!为什么??
items: [
{
xtype: 'checkbox',
name : 'insuranceVerified',
fieldLabel: 'insuranceVerified',
inputValue:'1',
value:'1' //does not make a difference
},
{
xtype: 'textfield',
name : 'ru',
fieldLabel: 'ru'
}
]
Run Code Online (Sandbox Code Playgroud)
我正在捕获保存按钮单击事件并在我的控制器中调用此函数:
updateEncounter: function(button) {
console.log('clicked the Save button');
var win = button.up('window'),
form = win.down('form'),
record = form.getRecord(),
values = form.getValues();
// values properly shows the ru field on the form, but only shows insuranceVerified if it's checked - is not in values if it's unchecked... ??!
debugger; …Run Code Online (Sandbox Code Playgroud)