Hello
This method would be generated for an Array Property that is indexed, but you can define it for any property.
The method takes in a value and then returns an array of value that need to be index.
For example if I have a property called kids that is a comma delimited list of my children: “Kaitlin,Melissa,Robin,Kieran”
I can pass that into KidsBuildValueArray and build an array:
Results(1)=”Kaitlin”
Results(2)=”Melissa”
Results(3)=”Robin”
Results(4)=”Kieran”
Here are my properties and index
Property Name
As %String;
Property KidsString
As %String;
ClassMethod KidsStringBuildValueArray(val,
result)
{
f i=1:1:$L(val,",")
s result(i)=$P(val,",",i)
}
Index Index2 On KidsString(ELEMENTS);
And after saving one object here are my globals
USER>s x=##class(User.BVA).%New()
USER>s x.Name="Brendan"
USER>s x.KidsString="Kaitlin,Melissa,Robin,Kieran"
USER>w x.%Save()
1
USER>zw ^User.BVAD
^User.BVAD=1
^User.BVAD(1)=$lb("","Brendan","","Kaitlin,Melissa,Robin,Kieran")
USER>zw ^User.BVAI
^User.BVAI("Index1"," ",1)=""
^User.BVAI("Index2"," KAITLIN",1)=""
^User.BVAI("Index2"," KIERAN",1)=""
^User.BVAI("Index2"," MELISSA",1)=""
^User.BVAI("Index2"," ROBIN",1)=""
USER>
--
--
Caché, Ensemble, DeepSee
---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
intersystems-publi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.